Can't set up the develpment environment

Hi, I'm trying to set up the dev env in kibana to be able to write plugins later.
I'm having trouble with the "npm run elasticsearch" command. It generates this error : sana@sana:~/kibana$ sudo npm run elasticsearch [sudo] password for sana:

kibana@6.0.0-alpha2 elasticsearch /home/sana/kibana
grunt esvm:dev:keepalive

Loading "ui_framework.js" tasks...ERROR

Error: Missing binding /home/sana/kibana/node_modules/node-sass/vendor/linux-x64-48/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 6.x

Found bindings for the following environments:

  • Linux 64-bit with Node.js 4.x

This usually happens because your environment has changed since running npm install.
Run npm rebuild node-sass to build the binding for your current environment.

Running "esvm:dev:keepalive" (esvm) task
starting up "dev" cluster
Keeping elasticsearch alive, to shutdown press command/control+c
INFO - - cluster - Downloading & installing from "master" branch.
INFO - - cluster - Installing plugins
INFO - - cluster - Starting 1 nodes
INFO - ? - ? - [2017-05-31T14:46:27,329][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] uncaught exception in thread [main]
INFO - ? - ? - org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
INFO - ? - ? - at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:127) ~[elasticsearch-6.0.0-alpha2-SNAPSHOT.jar:6.0.0-alpha2-SNAPSHOT]
INFO - ? - ? - at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:114) ~[elasticsearch-6.0.0-alpha2-SNAPSHOT.jar:6.0.0-alpha2-SNAPSHOT]
INFO - ? - ? - at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:67) ~[elasticsearch-6.0.0-alpha2-SNAPSHOT.jar:6.0.0-alpha2-SNAPSHOT]
INFO - ? - ? - at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) ~[elasticsearch-6.0.0-alpha2-SNAPSHOT.jar:6.0.0-alpha2-SNAPSHOT]
INFO - ? - ? - at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-6.0.0-alpha2-SNAPSHOT.jar:6.0.0-alpha2-SNAPSHOT]
INFO - ? - ? - at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-6.0.0-alpha2-SNAPSHOT.jar:6.0.0-alpha2-SNAPSHOT]
INFO - ? - ? - at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-6.0.0-alpha2-SNAPSHOT.jar:6.0.0-alpha2-SNAPSHOT]
INFO - ? - ? - Caused by: java.lang.RuntimeException: can not run elasticsearch as root
INFO - ? - ? - at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:105) ~[elasticsearch-6.0.0-alpha2-SNAPSHOT.jar:6.0.0-alpha2-SNAPSHOT]
INFO - ? - ? - at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:171) ~[elasticsearch-6.0.0-alpha2-SNAPSHOT.jar:6.0.0-alpha2-SNAPSHOT]
INFO - ? - ? - at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:330) ~[elasticsearch-6.0.0-alpha2-SNAPSHOT.jar:6.0.0-alpha2-SNAPSHOT]
INFO - ? - ? - at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-6.0.0-alpha2-SNAPSHOT.jar:6.0.0-alpha2-SNAPSHOT]
INFO - ? - ? - ... 6 more
Fatal error: Server exitted with the non-zero exit code 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! kibana@6.0.0-alpha2 elasticsearch: grunt esvm:dev:keepalive
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the kibana@6.0.0-alpha2 elasticsearch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/sana/.npm/_logs/2017-05-31T12_46_27_629Z-debug.log
sana@sana:~/kibana$ cat /home/sana/.npm/_logs/2017-05-31T12_46_27_629Z-debug.log0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'run',
1 verbose cli 'elasticsearch' ]
2 info using npm@4.6.1
3 info using node@v6.10.3
4 verbose run-script [ 'preelasticsearch', 'elasticsearch', 'postelasticsearch' ]
5 info lifecycle kibana@6.0.0-alpha2~preelasticsearch: kibana@6.0.0-alpha2
6 silly lifecycle kibana@6.0.0-alpha2~preelasticsearch: no script for preelasticsearch, continuing
7 info lifecycle kibana@6.0.0-alpha2~elasticsearch: kibana@6.0.0-alpha2
8 verbose lifecycle kibana@6.0.0-alpha2~elasticsearch: unsafe-perm in lifecycle true
9 verbose lifecycle kibana@6.0.0-alpha2~elasticsearch: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/sana/kibana/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
10 verbose lifecycle kibana@6.0.0-alpha2~elasticsearch: CWD: /home/sana/kibana
11 silly lifecycle kibana@6.0.0-alpha2~elasticsearch: Args: [ '-c', 'grunt esvm:dev:keepalive' ]
12 silly lifecycle kibana@6.0.0-alpha2~elasticsearch: Returned: code: 1 signal: null
13 info lifecycle kibana@6.0.0-alpha2~elasticsearch: Failed to exec elasticsearch script
14 verbose stack Error: kibana@6.0.0-alpha2 elasticsearch: grunt esvm:dev:keepalive
14 verbose stack Exit status 1
14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:886:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid kibana@6.0.0-alpha2
16 verbose cwd /home/sana/kibana
17 verbose Linux 4.11.2-041102-generic
18 verbose argv "/usr/bin/nodejs" "/usr/local/bin/npm" "run" "elasticsearch"
19 verbose node v6.10.3
20 verbose npm v4.6.1
21 error code ELIFECYCLE
22 error errno 1
23 error kibana@6.0.0-alpha2 elasticsearch: grunt esvm:dev:keepalive
23 error Exit status 1
24 error Failed at the kibana@6.0.0-alpha2 elasticsearch script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]

Can anyone helm me please?

For node-sass: this is usually caused by installing node modules when running a different version of node than you're currently running. For good measure, making sure the node version in .node_version is used, clearing out node_modules, and installing again should clear things up.

For npm run elasticsearch: elasticsearch isn't happy with running as root. Are you able to login or run the command as a different user?
edit: just noticed you're using sudo, you should be able to run the command without it

Heyy, thank you for responding.
I made sure i deleted the folder nodes-modules and run "npm install" to install the dependencies.
Also, I've tried running " npm run elasticsearch" without sudo and here's the error : `sana@sana:~/kibana$ npm run elasticsearch

kibana@6.0.0-alpha2 elasticsearch /home/sana/kibana
grunt esvm:dev:keepalive

Running "esvm:dev:keepalive" (esvm) task
starting up "dev" cluster
Keeping elasticsearch alive, to shutdown press command/control+c
Fatal error: EACCES: permission denied, unlink '/home/sana/kibana/esvm/dev/branch-master/LICENSE.txt'

npm ERR! Linux 4.11.2-041102-generic
npm ERR! argv "/home/sana/.nvm/versions/node/v6.10.2/bin/node" "/home/sana/.nvm/versions/node/v6.10.2/bin/npm" "run" "elasticsearch"
npm ERR! node v6.10.2
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! kibana@6.0.0-alpha2 elasticsearch: grunt esvm:dev:keepalive
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the kibana@6.0.0-alpha2 elasticsearch script 'grunt esvm:dev:keepalive'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the kibana package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! grunt esvm:dev:keepalive
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs kibana
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls kibana
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/sana/kibana/npm-debug.log
sana@sana:~/kibana$
sana@sana:~/kibana$ cat /home/sana/kibana/npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/home/sana/.nvm/versions/node/v6.10.2/bin/node',
1 verbose cli '/home/sana/.nvm/versions/node/v6.10.2/bin/npm',
1 verbose cli 'run',
1 verbose cli 'elasticsearch' ]
2 info using npm@3.10.10
3 info using node@v6.10.2
4 verbose run-script [ 'preelasticsearch', 'elasticsearch', 'postelasticsearch' ]
5 info lifecycle kibana@6.0.0-alpha2~preelasticsearch: kibana@6.0.0-alpha2
6 silly lifecycle kibana@6.0.0-alpha2~preelasticsearch: no script for preelasticsearch, continuing
7 info lifecycle kibana@6.0.0-alpha2~elasticsearch: kibana@6.0.0-alpha2
8 verbose lifecycle kibana@6.0.0-alpha2~elasticsearch: unsafe-perm in lifecycle true
9 verbose lifecycle kibana@6.0.0-alpha2~elasticsearch: PATH: /home/sana/.nvm/versions/node/v6.10.2/lib/node_modules/npm/bin/node-gyp-bin:/home/sana/kibana/node_modules/.bin:/home/sana/.nvm/versions/node/v6.10.2/bin:/home/sana/bin:/home/sana/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-openjdk-amd64
10 verbose lifecycle kibana@6.0.0-alpha2~elasticsearch: CWD: /home/sana/kibana
11 silly lifecycle kibana@6.0.0-alpha2~elasticsearch: Args: [ '-c', 'grunt esvm:dev:keepalive' ]
12 silly lifecycle kibana@6.0.0-alpha2~elasticsearch: Returned: code: 1 signal: null
13 info lifecycle kibana@6.0.0-alpha2~elasticsearch: Failed to exec elasticsearch script
14 verbose stack Error: kibana@6.0.0-alpha2 elasticsearch: grunt esvm:dev:keepalive
14 verbose stack Exit status 1
14 verbose stack at EventEmitter. (/home/sana/.nvm/versions/node/v6.10.2/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess. (/home/sana/.nvm/versions/node/v6.10.2/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:886:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid kibana@6.0.0-alpha2
16 verbose cwd /home/sana/kibana
17 error Linux 4.11.2-041102-generic
18 error argv "/home/sana/.nvm/versions/node/v6.10.2/bin/node" "/home/sana/.nvm/versions/node/v6.10.2/bin/npm" "run" "elasticsearch"
19 error node v6.10.2
20 error npm v3.10.10
21 error code ELIFECYCLE
22 error kibana@6.0.0-alpha2 elasticsearch: grunt esvm:dev:keepalive
22 error Exit status 1
23 error Failed at the kibana@6.0.0-alpha2 elasticsearch script 'grunt esvm:dev:keepalive'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the kibana package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error grunt esvm:dev:keepalive
23 error You can get information on how to open an issue for this project with:
23 error npm bugs kibana
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls kibana
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
`

esvm likely created some files that are now owned by root when we ran the command from earlier. Clearing out the esvm folder(will likely require sudo now), and re-running npm run elasticsearch should fix that.

I deleted the esvm folder, run "npm install" , permissed denied so I run "sudo npm install"
then run "npm run elasticsearch to get this error: https://pastebin.com/raw/zkE81m55

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