# Failed to build kibana 5.3.1 from source

**URL:** <https://discuss.elastic.co/t/failed-to-build-kibana-5-3-1-from-source/85911>\
**Category:** Kibana\
**Created:** [May 16, 2017, 10:58am UTC](https://discuss.elastic.co/t/failed-to-build-kibana-5-3-1-from-source/85911 "2017-05-16T10:58:54Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravihk71](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravihk71/32/18263_2.png) [@ravihk71](https://discuss.elastic.co/u/ravihk71)\
**Post date:** [May 16, 2017, 10:58am UTC](https://discuss.elastic.co/t/failed-to-build-kibana-5-3-1-from-source/85911/1 "2017-05-16T10:58:54Z")

</div>

Hi All,

When i tried to build kibana binary from source am facing issue while running command "npm run build"

Followed steps which are mentioned in [https://github.com/elastic/kibana/blob/5.x/CONTRIBUTING.md](https://github.com/elastic/kibana/blob/5.x/CONTRIBUTING.md)

npm install executed successfully.

When i tried with "npm run build" am getting below error.

Warning: Client request error: connect EHOSTUNREACH 104.20.22.46:443 Use --force to continue.

Aborted due to warnings.

npm ERR! Linux 3.10.0-327.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" "--debug"  
npm ERR! node v6.10.2  
npm ERR! npm v3.10.10  
npm ERR! code ELIFECYCLE  
npm ERR! kibana@5.3.3 build: `grunt build`  
npm ERR! Exit status 3  
npm ERR!  
npm ERR! Failed at the kibana@5.3.3 build script 'grunt build'.  
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  
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! /kibana/npm-debug.log

Am i missing something here?  
My requirement is to get the kibana rpm/binary from the source code.

---

<div class="post-metadata">

**Author:** ![Stacey\_Gammon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stacey_gammon/32/14025_2.png) [@Stacey\_Gammon](https://discuss.elastic.co/u/Stacey_Gammon)\
**Post date:** [May 16, 2017, 2:33pm UTC](https://discuss.elastic.co/t/failed-to-build-kibana-5-3-1-from-source/85911/2 "2017-05-16T14:33:38Z")

</div>

Can you run with `npm run build -- --debug` and paste the output? Maybe it will give us some extra information.

---

<div class="post-metadata">

**Author:** ![ravihk71](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravihk71/32/18263_2.png) [@ravihk71](https://discuss.elastic.co/u/ravihk71)\
**Post date:** [May 16, 2017, 2:36pm UTC](https://discuss.elastic.co/t/failed-to-build-kibana-5-3-1-from-source/85911/3 "2017-05-16T14:36:16Z")

</div>

> [@Stacey\_Gammon](#):
>
> npm run build -- --debug

Hello Thanks for the response.Even i tried with --debug but logs are same in both.Anyway i pasted complete log below.  
bash-4.2# npm run build -- --debug

> kibana@5.3.3 build /kibana  
> grunt build "--debug"

Running "build" task  
[D] Task source: tasks/build/index.js

Running "clean:build" (clean) task  
[D] Task source: /kibana/node\_modules/grunt-contrib-clean/tasks/clean.js

> > 0 paths cleaned.

Running "clean:target" (clean) task  
[D] Task source: /kibana/node\_modules/grunt-contrib-clean/tasks/clean.js

> > 0 paths cleaned.

Running "\_build:downloadNodeBuilds" task  
[D] Task source: tasks/build/download\_node\_builds.js  
Warning: Client request error: connect EHOSTUNREACH 104.20.22.46:443 Use --force to continue.

Aborted due to warnings.

npm ERR! Linux 3.10.0-327.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" "--" "--debug"  
npm ERR! node v6.10.2  
npm ERR! npm v3.10.10  
npm ERR! code ELIFECYCLE  
npm ERR! kibana@5.3.3 build: `grunt build "--debug"`  
npm ERR! Exit status 3  
npm ERR!  
npm ERR! Failed at the kibana@5.3.3 build script 'grunt build "--debug"'.  
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 "--debug"  
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! /kibana/npm-debug.log

Thank You

---

<div class="post-metadata">

**Author:** ![Stacey\_Gammon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stacey_gammon/32/14025_2.png) [@Stacey\_Gammon](https://discuss.elastic.co/u/Stacey_Gammon)\
**Post date:** [May 16, 2017, 2:47pm UTC](https://discuss.elastic.co/t/failed-to-build-kibana-5-3-1-from-source/85911/4 "2017-05-16T14:47:34Z")

</div>

> [@ravihk71](#):
>
> [D] Task source: tasks/build/download\_node\_builds.js  
> Warning: Client request error: connect EHOSTUNREACH 104.20.22.46:443 Use --force to continue.

Looks like this is what is causing the failure. Do you have access to an internet connection?

---

<div class="post-metadata">

**Author:** ![Stacey\_Gammon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stacey_gammon/32/14025_2.png) [@Stacey\_Gammon](https://discuss.elastic.co/u/Stacey_Gammon)\
**Post date:** [May 16, 2017, 2:48pm UTC](https://discuss.elastic.co/t/failed-to-build-kibana-5-3-1-from-source/85911/5 "2017-05-16T14:48:04Z")

</div>

I guess that's a stupid question since you are here responding to me. Doh! 🙂

---

<div class="post-metadata">

**Author:** ![ravihk71](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravihk71/32/18263_2.png) [@ravihk71](https://discuss.elastic.co/u/ravihk71)\
**Post date:** [May 16, 2017, 2:51pm UTC](https://discuss.elastic.co/t/failed-to-build-kibana-5-3-1-from-source/85911/6 "2017-05-16T14:51:53Z")

</div>

yes i do have an access to internet connection in my environment.I set proxy even with 'npm config set "proxy....." '

---

<div class="post-metadata">

**Author:** ![Stacey\_Gammon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stacey_gammon/32/14025_2.png) [@Stacey\_Gammon](https://discuss.elastic.co/u/Stacey_Gammon)\
**Post date:** [May 16, 2017, 2:55pm UTC](https://discuss.elastic.co/t/failed-to-build-kibana-5-3-1-from-source/85911/7 "2017-05-16T14:55:16Z")

</div>

Does `npm i` work?

---

<div class="post-metadata">

**Author:** ![ravihk71](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravihk71/32/18263_2.png) [@ravihk71](https://discuss.elastic.co/u/ravihk71)\
**Post date:** [May 16, 2017, 2:58pm UTC](https://discuss.elastic.co/t/failed-to-build-kibana-5-3-1-from-source/85911/8 "2017-05-16T14:58:04Z")

</div>

> [@Stacey\_Gammon](#):
>
> npm i

Yup It worked fine to me.But observed it skipped few optional dependencies.I believe that should be fine.  
FYI,  
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node\_modules/chokidar/node\_modules/fsevents):  
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","ar

---

<div class="post-metadata">

**Author:** ![Stacey\_Gammon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stacey_gammon/32/14025_2.png) [@Stacey\_Gammon](https://discuss.elastic.co/u/Stacey_Gammon)\
**Post date:** [May 16, 2017, 3:14pm UTC](https://discuss.elastic.co/t/failed-to-build-kibana-5-3-1-from-source/85911/9 "2017-05-16T15:14:23Z")

</div>

Can you hit the url directly? Try [https://nodejs.org/dist/v6.10.2/node-v6.10.2-darwin-x64.tar.gz](https://nodejs.org/dist/v6.10.2/node-v6.10.2-darwin-x64.tar.gz)

---

<div class="post-metadata">

**Author:** ![ravihk71](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravihk71/32/18263_2.png) [@ravihk71](https://discuss.elastic.co/u/ravihk71)\
**Post date:** [May 16, 2017, 3:20pm UTC](https://discuss.elastic.co/t/failed-to-build-kibana-5-3-1-from-source/85911/10 "2017-05-16T15:20:52Z")

</div>

Am able to wget [https://nodejs.org/dist/v6.10.2/node-v6.10.2-darwin-x64.tar.gz](https://nodejs.org/dist/v6.10.2/node-v6.10.2-darwin-x64.tar.gz)  
it downloads the tar file. Is that the one your talking about?

---

<div class="post-metadata">

**Author:** ![Stacey\_Gammon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stacey_gammon/32/14025_2.png) [@Stacey\_Gammon](https://discuss.elastic.co/u/Stacey_Gammon)\
**Post date:** [May 16, 2017, 3:30pm UTC](https://discuss.elastic.co/t/failed-to-build-kibana-5-3-1-from-source/85911/11 "2017-05-16T15:30:43Z")

</div>

Hmmm, do you need the npm config set proxy call? Are you behind a proxy?

What happens if you delete it (`npm config delete proxy`) and try the build again?

---

<div class="post-metadata">

**Author:** ![ravihk71](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravihk71/32/18263_2.png) [@ravihk71](https://discuss.elastic.co/u/ravihk71)\
**Post date:** [May 16, 2017, 3:34pm UTC](https://discuss.elastic.co/t/failed-to-build-kibana-5-3-1-from-source/85911/12 "2017-05-16T15:34:48Z")

</div>

Initially i tried without setting proxy through npm config But i faced same error.

---

<div class="post-metadata">

**Author:** ![Stacey\_Gammon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stacey_gammon/32/14025_2.png) [@Stacey\_Gammon](https://discuss.elastic.co/u/Stacey_Gammon)\
**Post date:** [May 16, 2017, 4:18pm UTC](https://discuss.elastic.co/t/failed-to-build-kibana-5-3-1-from-source/85911/13 "2017-05-16T16:18:29Z")

</div>

Can you build master or does the problem only exist on 5.3.1? Does `npm start` work?

---

<div class="post-metadata">

**Author:** ![ravihk71](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravihk71/32/18263_2.png) [@ravihk71](https://discuss.elastic.co/u/ravihk71)\
**Post date:** [May 17, 2017, 1:20pm UTC](https://discuss.elastic.co/t/failed-to-build-kibana-5-3-1-from-source/85911/14 "2017-05-17T13:20:19Z")

</div>

I did tried it on build master as well but faced same issue.Looks like The issue is the proxy and the use of wreck.Am still trying to figure out the fix.

npm run elasticsearch and npm start doesn't work for me.

bash-4.2# npm run elasticsearch

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

Loading "ui\_framework.js" tasks...ERROR

> > Error: ENOENT: no such file or directory, scandir '/kibana/node\_modules/node-sass/vendor'

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  
ERROR - - cluster - malformed log message: "/kibana/esvm/dev/branch-master/bin/elasticsearch: line 155: hostname: command not found"  
INFO - ? - ? - [2017-05-17T12:59:02,920][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-alpha1-SNAPSHOT.jar:6.0.0-alpha1-SNAPSHOT]  
INFO - ? - ? - at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:114) ~[elasticsearch-6.0.0-alpha1-SNAPSHOT.jar:6.0.0-alpha1-SNAPSHOT]  
INFO - ? - ? - at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:67) ~[elasticsearch-6.0.0-alpha1-SNAPSHOT.jar:6.0.0-alpha1-SNAPSHOT]  
INFO - ? - ? - at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) ~[elasticsearch-6.0.0-alpha1-SNAPSHOT.jar:6.0.0-alpha1-SNAPSHOT]  
INFO - ? - ? - at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-6.0.0-alpha1-SNAPSHOT.jar:6.0.0-alpha1-SNAPSHOT]  
INFO - ? - ? - at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-6.0.0-alpha1-SNAPSHOT.jar:6.0.0-alpha1-SNAPSHOT]  
INFO - ? - ? - at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-6.0.0-alpha1-SNAPSHOT.jar:6.0.0-alpha1-SNAPSHOT]  
INFO - ? - ? - Caused by: java.lang.RuntimeException: can not run elasticsearch as root  
INFO - ? - ? - at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:104) ~[elasticsearch-6.0.0-alpha1-SNAPSHOT.jar:6.0.0-alpha1-SNAPSHOT]  
INFO - ? - ? - at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:180) ~[elasticsearch-6.0.0-alpha1-SNAPSHOT.jar:6.0.0-alpha1-SNAPSHOT]  
INFO - ? - ? - at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:339) ~[elasticsearch-6.0.0-alpha1-SNAPSHOT.jar:6.0.0-alpha1-SNAPSHOT]  
INFO - ? - ? - at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-6.0.0-alpha1-SNAPSHOT.jar:6.0.0-alpha1-SNAPSHOT]  
INFO - ? - ? - ... 6 more  
Fatal error: Server exitted with the non-zero exit code 1

npm ERR! Linux 3.10.0-327.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" "elasticsearch"  
npm ERR! node v6.10.2  
npm ERR! npm v3.10.10  
npm ERR! code ELIFECYCLE

bash-4.2# npm start

> kibana@6.0.0-alpha2 start /kibana  
> sh ./bin/kibana --dev

watching for changes (355 files)  
optmzr log [12:55:32.443] [info][status][ui settings] Status changed from uninitialized to disabled - uiSettings.enabled config is set to `false`  
server log [12:55:32.582] [info][optimize] Waiting for optimizer completion  
optmzr log [12:55:32.660] [info][optimize] Lazy optimization of bundles for kibana, stateSessionStorageRedirect, timelion, sense-tests and status\_page ready  
optmzr log [12:55:32.665] [info][optimize] Lazy optimization started  
optmzr log [12:55:32.688] [info] Plugin initialization disabled.  
server log [12:55:32.800] [info][status][plugin:kibana@6.0.0-alpha2] Status changed from uninitialized to green - Ready  
server log [12:55:32.881] [info][status][plugin:elasticsearch@6.0.0-alpha2] Status changed from uninitialized to yellow - Waiting for Elasticsearch  
server log [12:55:32.910] [error][admin][elasticsearch] Request error, retrying  
HEAD [http://localhost:9200/](http://localhost:9200/) =\> connect ECONNREFUSED 127.0.0.1:9200  
server log [12:55:32.913] [info][status][plugin:console@6.0.0-alpha2] Status changed from uninitialized to green - Ready  
server log [12:55:32.918] [warning][admin][elasticsearch] Unable to revive connection: [http://localhost:9200/](http://localhost:9200/)  
server log [12:55:32.919] [warning][admin][elasticsearch] No living connections  
server log [12:55:32.924] [error][status][plugin:elasticsearch@6.0.0-alpha2] Status changed from yellow to red - Unable to connect to Elasticsearch at [http://localhost:9200](http://localhost:9200).  
server log [12:55:32.944] [info][status][plugin:metrics@6.0.0-alpha2] Status changed from uninitialized to green - Ready  
server log [12:55:34.421] [info][status][plugin:timelion@6.0.0-alpha2] Status changed from uninitialized to green - Ready  
server log [12:55:34.428] [info][listening] Server running at [https://localhost:5603](https://localhost:5603)  
server log [12:55:34.430] [error][status][ui settings] Status changed from uninitialized to red - Elasticsearch plugin is red  
server log [12:55:35.428] [warning][admin][elasticsearch] Unable to revive connection: [http://localhost:9200/](http://localhost:9200/)  
server log [12:55:35.431] [warning][admin][elasticsearch] No living connections  
server log [12:55:37.940] [warning][admin][elasticsearch] Unable to revive connection: [http://localhost:9200/](http://localhost:9200/)  
server log [12:55:37.940] [warning][admin][elasticsearch] No living connections

Is it mandatory to run elasticsearch and npm start before building kibana?

---

<div class="post-metadata">

**Author:** ![Stacey\_Gammon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stacey_gammon/32/14025_2.png) [@Stacey\_Gammon](https://discuss.elastic.co/u/Stacey_Gammon)\
**Post date:** [May 17, 2017, 1:26pm UTC](https://discuss.elastic.co/t/failed-to-build-kibana-5-3-1-from-source/85911/15 "2017-05-17T13:26:18Z")

</div>

> [@ravihk71](#):
>
> Is it mandatory to run elasticsearch and npm start before building kibana?

No. `npm run elasticsearch` starts up an elasticsearch instance for Kibana to run against which can help with development so you don't have to kick up an es instance separately. You'll need to have some elasticsearch instance to run against, but it doesn't have to be by the command `npm run elasticsearch`. For instance, I have the elasticsearch repo checked out and run `gradle run` in that folder to start an instance.

`npm start` starts Kibana without building any binaries, while `npm run build` will create the binaries you can then use to run Kibana.

I was asking only to see if the error was more widespread or only with the build process.

Regarding the error:

> Error: ENOENT: no such file or directory, scandir '/kibana/node\_modules/node-sass/vendor'

Sounds like npm install did not finish correctly - that folder should be in your node\_modules as a result of that call.

---

<div class="post-metadata">

**Author:** ![ravihk71](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravihk71/32/18263_2.png) [@ravihk71](https://discuss.elastic.co/u/ravihk71)\
**Post date:** [May 17, 2017, 2:17pm UTC](https://discuss.elastic.co/t/failed-to-build-kibana-5-3-1-from-source/85911/16 "2017-05-17T14:17:12Z")

</div>

Hi,

Thanks a lot for your response for my queries.Finally am able to build the kibana successfully.  
Referred [https://github.com/hapijs/wreck/issues/64](https://github.com/hapijs/wreck/issues/64) (one of my team member suggested)  
Workaround to fix this issues.

From the source code need to modify the kibana/tasks/build/download\_node\_builds.js  
file.

Delete:  
import wreck from 'wreck';

Add:  
const Wreck = require('wreck');  
const HttpProxyAgent = require('https-proxy-agent');  
const proxy = process.env.https\_proxy || '[http://127.0.0.1:80](http://127.0.0.1:80)'; // this is placeholder logic  
const agent = new HttpProxyAgent(proxy);  
const wreck = Wreck.defaults({  
agent  
});

Then i tried to execute "npm run build" and am able to proceed further.

Thanks,  
Ravi

---

<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:** [June 14, 2017, 2:17pm UTC](https://discuss.elastic.co/t/failed-to-build-kibana-5-3-1-from-source/85911/17 "2017-06-14T14:17:13Z")

</div>

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