Kibana: [kbn-plugin-generator] Error: spawnSync bin/kibana ENOENT

Created on 16 Mar 2018  路  3Comments  路  Source: elastic/kibana

Previously I generated the plugin using template-kibana-plugin against kibana 6.2, and basically it was working well.

Since a bundled plugin generator is included in >=6.3, So I tried to generate a new plugin using the bundled plugin generator against kibana 6.x, then I saw this issue. The plugin was generated in directory ../kibana-extra/example_v_2. The steps are as below,

  1. git clone https://github.com/elastic/kibana.git kibana
  2. cd kibana
  3. git checkout 6.x
  4. nvm install "$(cat .node-version)"
  5. yarn kbn bootstrap
  6. yarn elasticsearch
    Note: Everything is fine so far.
  7. node scripts/generate_plugin example_v2
    Then the plugin is created in directory "../kibana-extra/example_v_2". So the first question/issue is why I set the plugin name as "example_v2", but the plugin-generate created "example_v_2"?
  8. cd ../kibana-extra/example_v_2
  9. yarn kbn bootstrap;
  10. yarn start
    Then I saw the following error:
yarn run v1.5.1
warning package.json: No license field
$ plugin-helpers start
child_process.js:624
    throw err;
    ^

Error: spawnSync bin/kibana ENOENT
    at _errnoException (util.js:1022:11)
    at spawnSync (child_process.js:579:20)
    at execFileSync (child_process.js:616:13)
    at module.exports (/home/opc/benjamin/js/kibana_plugins/kibana/packages/kbn-plugin-helpers/tasks/start/start_action.js:19:3)
    at run (/home/opc/benjamin/js/kibana_plugins/kibana/packages/kbn-plugin-helpers/lib/run.js:9:10)
    at /home/opc/benjamin/js/kibana_plugins/kibana/packages/kbn-plugin-helpers/cli.js:25:7
    at Command.actionWrapper (/home/opc/benjamin/js/kibana_plugins/kibana/packages/kbn-plugin-helpers/cli.js:12:8)
    at Command.listener (/home/opc/benjamin/js/kibana_plugins/kibana/packages/kbn-plugin-helpers/node_modules/commander/index.js:315:8)
    at emitTwo (events.js:126:13)
    at Command.emit (events.js:214:7)
error An unexpected error occurred: "Command failed.
Exit code: 1
Command: sh
Arguments: -c plugin-helpers start
Directory: /home/opc/benjamin/js/kibana_plugins/kibana-extra/guard_v_2
Output:
".
info If you think this is a bug, please open a bug report with the information provided in "/home/opc/benjamin/js/kibana_plugins/kibana-extra/guard_v_2/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command
Core

Most helpful comment

Shouldn't this step be mentioned here?

All 3 comments

Hi,

I am facing the exact same issue. I followed the steps mentioned on (https://github.com/elastic/kibana/tree/6.x/packages/kbn-plugin-generator) and i receive the following error.

image

I can upload the trace file if needed, please let me know. Copying the folder to the plugins directory allows me to view the plugin in Kibana, but trying to start it from the kibana-extra directory results in this error.

image

Notice that all versions are same and I was able to start the test plugin by copying it in the directory.

https://github.com/elastic/kibana/issues/16784

setting KIBANA_ROOT worked for me

Shouldn't this step be mentioned here?

Was this page helpful?
0 / 5 - 0 ratings