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,
-
git clone https://github.com/elastic/kibana.git kibana
-
cd kibana
-
git checkout 6.x
-
nvm install "$(cat .node-version)"
-
yarn kbn bootstrap
-
yarn elasticsearch
Note: Everything is fine so far. -
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"? -
cd ../kibana-extra/example_v_2
-
yarn kbn bootstrap;
-
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