run:optimizeBuild

when i use npm run build -- --skip-os-packages
i got the problem
Running "run:optimizeBuild" (run) task
Warning: spawn EACCES Use --force to continue.

Aborted due to warnings.

npm ERR! Linux 3.10.0-514.26.2.el7.x86_64
npm ERR! argv "/root/.nvm/versions/node/v6.10.2/bin/node" "/root/.nvm/versions/node/v6.10.2/bin/npm" "run" "build" "--" "--skip-os-packages"
npm ERR! node v6.10.2
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! kibana@5.5.0 build: grunt build "--skip-os-packages"
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the kibana@5.5.0 build script 'grunt build "--skip-os-packages"'.
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 build "--skip-os-packages"
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! /usr/kibana/npm-debug.log.
are there some suggestions?
Someone said delete the node_modules and npm install again
i execute it but the problem still exists .

this is npm-debug.log:
0 info it worked if it ends with ok
1 verbose cli [ '/root/.nvm/versions/node/v6.10.2/bin/node',
1 verbose cli '/root/.nvm/versions/node/v6.10.2/bin/npm',
1 verbose cli 'run',
1 verbose cli 'build',
1 verbose cli '--',
1 verbose cli '--skip-os-packages' ]
2 info using npm@3.10.10
3 info using node@v6.10.2
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle kibana@5.5.0~prebuild: kibana@5.5.0
6 silly lifecycle kibana@5.5.0~prebuild: no script for prebuild, continuing
7 info lifecycle kibana@5.5.0~build: kibana@5.5.0
8 verbose lifecycle kibana@5.5.0~build: unsafe-perm in lifecycle true
9 verbose lifecycle kibana@5.5.0~build: PATH: /root/.nvm/versions/node/v6.10.2/lib/node_modules/npm/bin/node-gyp-bin:/usr/kibana/node_modules/.bin:/usr/java/jdk1.8.0_111/bin:/root
/.nvm/versions/node/v6.10.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/hadoop/sbin:/usr/local/hadoop/bin:/root/bin
10 verbose lifecycle kibana@5.5.0~build: CWD: /usr/kibana
11 silly lifecycle kibana@5.5.0~build: Args: [ '-c', 'grunt build "--skip-os-packages"' ]
12 silly lifecycle kibana@5.5.0~build: Returned: code: 3 signal: null
13 info lifecycle kibana@5.5.0~build: Failed to exec build script
14 verbose stack Error: kibana@5.5.0 build: grunt build "--skip-os-packages"
14 verbose stack Exit status 3
14 verbose stack at EventEmitter. (/root/.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. (/root/.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@5.5.0
16 verbose cwd /usr/kibana
17 error Linux 3.10.0-514.26.2.el7.x86_64
18 error argv "/root/.nvm/versions/node/v6.10.2/bin/node" "/root/.nvm/versions/node/v6.10.2/bin/npm" "run" "build" "--" "--skip-os-packages"
19 error node v6.10.2
20 error npm v3.10.10
21 error code ELIFECYCLE
22 error Exit status 3
23 error Failed at the kibana@5.5.0 build script 'grunt build "--skip-os-packages"'.
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 build "--skip-os-packages"
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 ]

Hi @xiaopeng_zhang,

I assume you are running this on linux? Are fpm, pleaserun, dpkg, and rpm installed and available as described in https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#building-os-packages?

hey i listened to you.beacuse i use the centos7.
i use yum install ruby-devel
and gem install fpm -v 1.5.0 gem install pleaserun -v 0.0.24.
but the problem still exists.
Running "run:optimizeBuild" (run) task
Warning: spawn EACCES Use --force to continue.

Aborted due to warnings.

npm ERR! Linux 3.10.0-514.26.2.el7.x86_64
npm ERR! argv "/root/.nvm/versions/node/v6.10.2/bin/node" "/root/.nvm/versions/node/v6.10.2/bin/npm" "run" "build" "--" "--skip-os-packages"
npm ERR! node v6.10.2
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! kibana@5.5.0 build: grunt build "--skip-os-packages"
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the kibana@5.5.0 build script 'grunt build "--skip-os-packages"'.
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 build "--skip-os-packages"
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! /usr/kibana/npm-debug.log
npm-debug.log:
0 info it worked if it ends with ok
1 verbose cli [ '/root/.nvm/versions/node/v6.10.2/bin/node',
1 verbose cli '/root/.nvm/versions/node/v6.10.2/bin/npm',
1 verbose cli 'run',
1 verbose cli 'build',
1 verbose cli '--',
1 verbose cli '--skip-os-packages' ]
2 info using npm@3.10.10
3 info using node@v6.10.2
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle kibana@5.5.0~prebuild: kibana@5.5.0
6 silly lifecycle kibana@5.5.0~prebuild: no script for prebuild, continuing
7 info lifecycle kibana@5.5.0~build: kibana@5.5.0
8 verbose lifecycle kibana@5.5.0~build: unsafe-perm in lifecycle true
9 verbose lifecycle kibana@5.5.0~build: PATH: /root/.nvm/versions/node/v6.10.2/lib/node_modules/npm/bin/node-gyp-bin:/usr/kibana/node_modules/.bin:/usr/java/jdk1.8.0_111/bin:/root
/.nvm/versions/node/v6.10.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/hadoop/sbin:/usr/local/hadoop/bin:/root/bin
10 verbose lifecycle kibana@5.5.0~build: CWD: /usr/kibana
11 silly lifecycle kibana@5.5.0~build: Args: [ '-c', 'grunt build "--skip-os-packages"' ]
12 silly lifecycle kibana@5.5.0~build: Returned: code: 3 signal: null
13 info lifecycle kibana@5.5.0~build: Failed to exec build script
14 verbose stack Error: kibana@5.5.0 build: grunt build "--skip-os-packages"
14 verbose stack Exit status 3
14 verbose stack at EventEmitter. (/root/.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. (/root/.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@5.5.0
16 verbose cwd /usr/kibana
17 error Linux 3.10.0-514.26.2.el7.x86_64
18 error argv "/root/.nvm/versions/node/v6.10.2/bin/node" "/root/.nvm/versions/node/v6.10.2/bin/npm" "run" "build" "--" "--skip-os-packages"
19 error node v6.10.2
20 error npm v3.10.10
21 error code ELIFECYCLE
22 error Exit status 3
23 error Failed at the kibana@5.5.0 build script 'grunt build "--skip-os-packages"'.
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 build "--skip-os-packages"
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 ]

The paths contained in the error message indicate that at least parts of the build process have been executed as root. The spawn EACCES indicates that a permission problem is present. Please make sure that the Kibana source directory and all files and directories therein are owned and writable by the user used to run the npm build command.

i run ls -l
[root@zk1 kibana]# ls -l
drwxr-xr-x 2 root root 4096 8月 16 17:04 bin
drwxr-xr-x 4 root root 4096 8月 31 11:41 build
drwxr-xr-x 2 root root 4096 8月 16 17:04 config
-rw-r--r-- 1 root root 22380 8月 16 17:04 CONTRIBUTING.md
drwxr-xr-x 2 root root 4096 8月 16 17:04 data
drwxr-xr-x 15 root root 4096 8月 16 17:04 docs
drwxr-xr-x 3 root root 4096 8月 16 17:04 esvm
-rw-r--r-- 1 root root 1964 8月 16 17:04 FAQ.md
-rw-r--r-- 1 root root 2189 8月 16 17:04 Gruntfile.js
-rw-r--r-- 1 root root 43339 8月 16 17:04 libesvm.cache.3.8.6.json
-rw-r--r-- 1 root root 569 8月 16 17:04 LICENSE.md
drwxr-xr-x 3 root root 4096 8月 16 17:04 maps
drwxr-xr-x 1190 root root 36864 8月 31 13:58 node_modules
drwxr-xr-x 4 root root 4096 8月 16 17:04 optimize
-rw-r--r-- 1 root root 9211 8月 16 17:04 package.json
drwxr-xr-x 3 root root 4096 8月 16 17:04 packages
drwxr-xr-x 2 root root 4096 8月 16 17:04 plugins
-rw-r--r-- 1 root root 5200 8月 16 17:04 README.md
drwxr-xr-x 2 root root 4096 8月 16 17:04 scripts
drwxr-xr-x 16 root root 4096 8月 17 10:37 src
-rw-r--r-- 1 root root 608 8月 16 17:04 STYLEGUIDE.md
drwxr-xr-x 2 root root 4096 8月 16 17:04 style_guides
drwxr-xr-x 6 root root 4096 8月 16 17:04 tasks
drwxr-xr-x 7 root root 4096 8月 16 17:04 test
drwxr-xr-x 7 root root 4096 8月 16 17:04 ui_framework
drwxr-xr-x 3 root root 4096 8月 16 17:04 utilities
drwxr-xr-x 2 root root 4096 8月 16 17:04 webpackShims
-rw-r--r-- 1 root root 1446 8月 16 17:04 zh-CONTRIBUTING.md
i think root has the permission.
Do i need to input any command?

How did you obtain the Kibana sources? Did you clone them via git?

yes. i use git clone .And i run git checkout 5.5.0 to change the tag.

I just tried to reproduce your problem with a clean clone of Kibana 5.5.0, but it worked fine for me. So we need to find which file causes the permission error. Can you take a look at the permissions of ./build/kibana/bin/kibana?

ls -l:
-rw-r--r-- 1 root root 636 8月 16 17:04 kibana
-rw-r--r-- 1 root root 509 8月 16 17:04 kibana.bat
-rw-r--r-- 1 root root 643 8月 16 17:04 kibana-plugin
-rw-r--r-- 1 root root 516 8月 16 17:04 kibana-plugin.bat

i mainly translate the contents of the kibana for chinese. All changes are on the /src.
So i have tried to move /src to a new clean clone of kibana 5.5.0.This raises the above problem.

The binaries in the ./build/kibana/bin/kibana directory seem to be missing the execute permissions. This is what it looks like in a working build for me:

$ ls -l build/kibana/bin
-rwxr-xr-x  1 user users  632 Sep 11 12:37 kibana
-rw-r--r--  1 user users  507 Sep 11 12:37 kibana.bat
-rwxr-xr-x  1 user users  639 Sep 11 12:37 kibana-plugin
-rw-r--r--  1 user users  514 Sep 11 12:37 kibana-plugin.bat

The permission bits need to be preserved when copying. Depending on the tools and filesystems used that might not always be the case.

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