elastic / template-kibana-plugin

sao.js template for kibana plugins
Apache License 2.0
64 stars 34 forks source link

Error: spawnSync bin\kibana.bat ENOENT #16

Closed LinFeng1997 closed 6 years ago

LinFeng1997 commented 6 years ago

my enviroment:

When I run sao kibana-plugin@7.2.4 ,error occur,Why? image

w33ble commented 6 years ago

It's very likely a version conflict, either with Kibana or the dependencies in the template. Kibana is changing how things run, but the compa chart in the readme should be correct.

What version of Kibana are you trying to use?

w33ble commented 6 years ago

And also, what does your directory structure look like, specifically, where is your plugin located relative to the kibana repo's path?

ahrtr commented 6 years ago

hi @w33ble , I just saw the same issue. 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
w33ble commented 6 years ago

This repo and the new template in 6.3+ are different beasts. The later is a basically a fork of the former. You can find it here: https://github.com/elastic/kibana/tree/master/packages/kbn-plugin-generator

Sounds like there are some issues with that fork. @ahrtr you should open an issue in the Kibana repo with this information, it's not something that can be fixed here.

w33ble commented 6 years ago

I still think the original issue here was a version mis-match, and there's been no response from the author, so I'm closing this issue. Can re-open with more input.

ahrtr commented 6 years ago

@w33ble , thanks for the feedback, I just raised a new issue as below, https://github.com/elastic/kibana/issues/17190