Is there a way to include external node module in my Kibana distributable?


I created my plugin, and it requires a module that I've installed using 'yarn add node-ssh'.

I did:

  1. ' yarn add @types/ssh2 ' in kibana directory.
  2. ' yarn add node-ssh' also.
  3. in 'server/routes.ts', wrote import { NodeSSH } from 'node-ssh';
  4. cd to kibana directory, did yarn build.
  5. installed kibana with an archive yarn had builded.

But in distributed Kibana, there's no 'node-ssh' in node_modules.
So my plugin doesn't work. Could you help me with it?

Hi @kyh119 ,

It should be possible, please check the similar question Adding dependency to custom plugin (New Platform)

Regards, Dzmitry

Hi @Dzmitry , thanks for your answer.

I read the topic you posted, but I have a question.

I couldn't figured out clearly what "They should be included in the 3rd party plugin's downloaded archive" means.

Could you kindly guide for me how to include npm modules in the 3rd party plugin's downloaded archive?

Do you mean the archive that created when I use 'yarn build' at kibana directory?

Thank you.

@kyh119 ,

I think you should build your custom plugin and then manually modify archive to include dependencies. Then you should install your plugin per instructions.

Give it a try and let me know.

Regards, Dzmitry

A tiny nit: I don't think you need to modify a built artifact. Other steps look correct.

Hi, @Mikhail_Shustov

Could you explain to me what "other steps" are?
Is there any other good way to add dependencies?

I was gonna try to modify a built archive, though.

Thank you all.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.