# run:optimizeBuild

**URL:** <https://discuss.elastic.co/t/run-optimizebuild/98823>\
**Category:** Kibana\
**Created:** [August 30, 2017, 8:58am UTC](https://discuss.elastic.co/t/run-optimizebuild/98823 "2017-08-30T08:58:58Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![xiaopeng\_zhang](https://avatars.discourse-cdn.com/v4/letter/x/71e660/32.png) [@xiaopeng\_zhang](https://discuss.elastic.co/u/xiaopeng_zhang)\
**Post date:** [August 30, 2017, 8:58am UTC](https://discuss.elastic.co/t/run-optimizebuild/98823/1 "2017-08-30T08:58:58Z")

</div>

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 .

---

<div class="post-metadata">

**Author:** ![xiaopeng\_zhang](https://avatars.discourse-cdn.com/v4/letter/x/71e660/32.png) [@xiaopeng\_zhang](https://discuss.elastic.co/u/xiaopeng_zhang)\
**Post date:** [August 30, 2017, 9:20am UTC](https://discuss.elastic.co/t/run-optimizebuild/98823/3 "2017-08-30T09:20:11Z")

</div>

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]

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [August 30, 2017, 3:35pm UTC](https://discuss.elastic.co/t/run-optimizebuild/98823/4 "2017-08-30T15:35:55Z")

</div>

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](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#building-os-packages)?

---

<div class="post-metadata">

**Author:** ![xiaopeng\_zhang](https://avatars.discourse-cdn.com/v4/letter/x/71e660/32.png) [@xiaopeng\_zhang](https://discuss.elastic.co/u/xiaopeng_zhang)\
**Post date:** [August 31, 2017, 1:47am UTC](https://discuss.elastic.co/t/run-optimizebuild/98823/6 "2017-08-31T01:47:17Z")

</div>

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]

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [August 31, 2017, 8:59am UTC](https://discuss.elastic.co/t/run-optimizebuild/98823/7 "2017-08-31T08:59:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![xiaopeng\_zhang](https://avatars.discourse-cdn.com/v4/letter/x/71e660/32.png) [@xiaopeng\_zhang](https://discuss.elastic.co/u/xiaopeng_zhang)\
**Post date:** [September 1, 2017, 1:06am UTC](https://discuss.elastic.co/t/run-optimizebuild/98823/8 "2017-09-01T01:06:22Z")

</div>

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](http://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](http://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](http://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](http://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](http://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](http://zh-CONTRIBUTING.md)  
i think root has the permission.  
Do i need to input any command?

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [September 1, 2017, 7:59am UTC](https://discuss.elastic.co/t/run-optimizebuild/98823/9 "2017-09-01T07:59:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![xiaopeng\_zhang](https://avatars.discourse-cdn.com/v4/letter/x/71e660/32.png) [@xiaopeng\_zhang](https://discuss.elastic.co/u/xiaopeng_zhang)\
**Post date:** [September 7, 2017, 3:14am UTC](https://discuss.elastic.co/t/run-optimizebuild/98823/10 "2017-09-07T03:14:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [September 7, 2017, 8:48am UTC](https://discuss.elastic.co/t/run-optimizebuild/98823/11 "2017-09-07T08:48:21Z")

</div>

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`?

---

<div class="post-metadata">

**Author:** ![xiaopeng\_zhang](https://avatars.discourse-cdn.com/v4/letter/x/71e660/32.png) [@xiaopeng\_zhang](https://discuss.elastic.co/u/xiaopeng_zhang)\
**Post date:** [September 7, 2017, 9:24am UTC](https://discuss.elastic.co/t/run-optimizebuild/98823/12 "2017-09-07T09:24:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![xiaopeng\_zhang](https://avatars.discourse-cdn.com/v4/letter/x/71e660/32.png) [@xiaopeng\_zhang](https://discuss.elastic.co/u/xiaopeng_zhang)\
**Post date:** [September 7, 2017, 9:29am UTC](https://discuss.elastic.co/t/run-optimizebuild/98823/13 "2017-09-07T09:29:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [September 11, 2017, 11:18am UTC](https://discuss.elastic.co/t/run-optimizebuild/98823/14 "2017-09-11T11:18:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 9, 2017, 11:18am UTC](https://discuss.elastic.co/t/run-optimizebuild/98823/15 "2017-10-09T11:18:40Z")

</div>

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