# Kibana build error

**URL:** <https://discuss.elastic.co/t/kibana-build-error/177904>\
**Category:** Kibana\
**Created:** [April 22, 2019, 9:21pm UTC](https://discuss.elastic.co/t/kibana-build-error/177904 "2019-04-22T21:21:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasmineL](https://avatars.discourse-cdn.com/v4/letter/j/8797f3/32.png) [@jasmineL](https://discuss.elastic.co/u/jasmineL)\
**Post date:** [April 22, 2019, 9:21pm UTC](https://discuss.elastic.co/t/kibana-build-error/177904/1 "2019-04-22T21:21:38Z")

</div>

I am trying to build Kibana 6.6 and see `spawn fpm ENOENT` error.  
I am running command `yarn build` without any options.

**Below is the error.**

> info [kibana] Creating deb package  
> │ debg calling fpm with args: [ '--force',  
> │ '-t',  
> │ 'deb',  
> │ '--package',  
> │ '/Users/j0l03mx/repo/kibana/kibana-ext/target/NAME-6.6.3-SNAPSHOT-ARCH.TYPE',  
> │ '-s',  
> │ 'dir',  
> │ '--name',  
> │ 'kibana',  
> │ '--description',  
> │ 'Explore and visualize your Elasticsearch data',  
> │ '--version',  
> │ '6.6.3-SNAPSHOT',  
> │ '--url',  
> │ '[https://www.elastic.co](https://www.elastic.co)',  
> │ '--vendor',  
> │ 'Elasticsearch, Inc.',  
> │ '--maintainer',  
> │ 'Kibana Team [info@elastic.co](mailto:info@elastic.co)',  
> │ '--license',  
> │ 'Elastic-License',  
> │ '--conflicts',  
> │ 'kibana-oss',  
> │ '--after-install',  
> │ '/Users/j0l03mx/repo/kibana/kibana-ext/src/dev/build/tasks/os\_packages/package\_scripts/post\_install.sh',  
> │ '--before-install',  
> │ '/Users/j0l03mx/repo/kibana/kibana-ext/src/dev/build/tasks/os\_packages/package\_scripts/pre\_install.sh',  
> │ '--before-remove',  
> │ '/Users/j0l03mx/repo/kibana/kibana-ext/src/dev/build/tasks/os\_packages/package\_scripts/pre\_remove.sh',  
> │ '--after-remove',  
> │ '/Users/j0l03mx/repo/kibana/kibana-ext/src/dev/build/tasks/os\_packages/package\_scripts/post\_remove.sh',  
> │ '--config-files',  
> │ '/etc/kibana/kibana.yml',  
> │ '--template-value',  
> │ 'user=kibana',  
> │ '--template-value',  
> │ 'group=kibana',  
> │ '--template-value',  
> │ 'optimizeDir=/usr/share/kibana/optimize',  
> │ '--template-value',  
> │ 'configDir=/etc/kibana',  
> │ '--template-value',  
> │ 'pluginsDir=/usr/share/kibana/plugins',  
> │ '--template-value',  
> │ 'dataDir=/var/lib/kibana',  
> │ '--exclude',  
> │ 'usr/share/kibana/config',  
> │ '--exclude',  
> │ 'usr/share/kibana/data',  
> │ '--architecture',  
> │ 'amd64',  
> │ '--deb-priority',  
> │ 'optional',  
> │ '/Users/j0l03mx/repo/kibana/kibana-ext/build/default/kibana-6.6.3-SNAPSHOT-linux-x86\_64/=/usr/share/kibana/',  
> │ '/Users/j0l03mx/repo/kibana/kibana-ext/build/default/kibana-6.6.3-SNAPSHOT-linux-x86\_64/config/=/etc/kibana/',  
> │ '/Users/j0l03mx/repo/kibana/kibana-ext/build/default/kibana-6.6.3-SNAPSHOT-linux-x86\_64/data/=/var/lib/kibana/',  
> │ '/Users/j0l03mx/repo/kibana/kibana-ext/src/dev/build/tasks/os\_packages/service\_templates/sysv/etc/=/etc/',  
> │ '/Users/j0l03mx/repo/kibana/kibana-ext/src/dev/build/tasks/os\_packages/service\_templates/systemd/etc/=/etc/' ]  
> │ info $ fpm --force -t deb --package /Users/j0l03mx/repo/kibana/kibana-ext/target/NAME-6.6.3-SNAPSHOT-ARCH.TYPE -s dir --name kibana --description Explore and visualize your Elasticsearch data --version 6.6.3-SNAPSHOT --url [https://www.elastic.co](https://www.elastic.co) --vendor Elasticsearch, Inc. --maintainer Kibana Team [info@elastic.co](mailto:info@elastic.co) --license Elastic-License --conflicts kibana-oss --after-install /Users/j0l03mx/repo/kibana/kibana-ext/src/dev/build/tasks/os\_packages/package\_scripts/post\_install.sh --before-install /Users/j0l03mx/repo/kibana/kibana-ext/src/dev/build/tasks/os\_packages/package\_scripts/pre\_install.sh --before-remove /Users/j0l03mx/repo/kibana/kibana-ext/src/dev/build/tasks/os\_packages/package\_scripts/pre\_remove.sh --after-remove /Users/j0l03mx/repo/kibana/kibana-ext/src/dev/build/tasks/os\_packages/package\_scripts/post\_remove.sh --config-files /etc/kibana/kibana.yml --template-value user=kibana --template-value group=kibana --template-value optimizeDir=/usr/share/kibana/optimize --template-value configDir=/etc/kibana --template-value pluginsDir=/usr/share/kibana/plugins --template-value dataDir=/var/lib/kibana --exclude usr/share/kibana/config --exclude usr/share/kibana/data --architecture amd64 --deb-priority optional /Users/j0l03mx/repo/kibana/kibana-ext/build/default/kibana-6.6.3-SNAPSHOT-linux-x86\_64/=/usr/share/kibana/ /Users/j0l03mx/repo/kibana/kibana-ext/build/default/kibana-6.6.3-SNAPSHOT-linux-x86\_64/config/=/etc/kibana/ /Users/j0l03mx/repo/kibana/kibana-ext/build/default/kibana-6.6.3-SNAPSHOT-linux-x86\_64/data/=/var/lib/kibana/ /Users/j0l03mx/repo/kibana/kibana-ext/src/dev/build/tasks/os\_packages/service\_templates/sysv/etc/=/etc/ /Users/j0l03mx/repo/kibana/kibana-ext/src/dev/build/tasks/os\_packages/service\_templates/systemd/etc/=/etc/  
> │ERROR failure  
> │ERROR Error: spawn fpm ENOENT  
> │ at Process.ChildProcess.\_handle.onexit (internal/child\_process.js:240:19)  
> │ at onErrorNT (internal/child\_process.js:415:16)  
> │ at process.\_tickCallback (internal/process/next\_tick.js:63:19)  
> error Command failed with exit code 1.  
> info Visit [yarn run | Yarn](https://yarnpkg.com/en/docs/cli/run) for documentation about this command.

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [April 22, 2019, 11:17pm UTC](https://discuss.elastic.co/t/kibana-build-error/177904/2 "2019-04-22T23:17:40Z")

</div>

HI,  
Probaly, you can try and delete the optimize folder in the kibana folder and restarting Kibana. There have been improvements to not having the optimization process failing in Kibana.  
I saw similar issue being reported here: [https://github.com/elastic/kibana/issues/17190](https://github.com/elastic/kibana/issues/17190)

Is there a version mismatch btw Kibana and ES ? Also thinking its a permission issue. Try setting it as KIBANA\_ROOT and check it if it works?

Thanks  
Rashmi

---

<div class="post-metadata">

**Author:** ![jasmineL](https://avatars.discourse-cdn.com/v4/letter/j/8797f3/32.png) [@jasmineL](https://discuss.elastic.co/u/jasmineL)\
**Post date:** [April 24, 2019, 11:24pm UTC](https://discuss.elastic.co/t/kibana-build-error/177904/3 "2019-04-24T23:24:43Z")

</div>

Hi Rashmi,

Sorry for the late reply and thanks a lot for your information.  
Here is what I have done.

1. git clone [https://github.com/elastic/kibana.git](https://github.com/elastic/kibana.git) kibana
2. cd kibana
3. git checkout 6.6
4. yarn kbn bootstrap  
--- And running kibana with yarn start works all fine.
5. yarn build

Running Kibana itself is all fine. The issue is when I try to build. The kibana version is 6.6 and if I understand correctly, the build shouldn't matter with elasticsearch version?

And what does 'KIBANA\_ROOT' mean as you mentioned above? Where should I set this?

Thank you so much!!  
Jasmine

---

<div class="post-metadata">

**Author:** ![jbudz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbudz/32/45922_2.png) [@jbudz](https://discuss.elastic.co/u/jbudz)\
**Post date:** [April 25, 2019, 3:32pm UTC](https://discuss.elastic.co/t/kibana-build-error/177904/4 "2019-04-25T15:32:05Z")

</div>

Kibana uses the ruby gem `fpm` to build deb and rpm packages. If you don't need deb or rpm builds you can `yarn build --skip-os-packages`, or if you do `gem install fpm`. [https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#building-os-packages](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#building-os-packages) has a little more info for further reading

---

<div class="post-metadata">

**Author:** ![jasmineL](https://avatars.discourse-cdn.com/v4/letter/j/8797f3/32.png) [@jasmineL](https://discuss.elastic.co/u/jasmineL)\
**Post date:** [May 9, 2019, 6:35pm UTC](https://discuss.elastic.co/t/kibana-build-error/177904/5 "2019-05-09T18:35:31Z")

</div>

Hi,  
Sorry for really long wait response and thanks a lot for your comments.  
Actually we are trying to setup a Kibana build environment from the git source. I talked to our team members, here are some questions I have.

1. Is there a specific Linux and version required to build Kibana 6.6? Would CentOs Linux works?
2. Is there any other dependencies? From the document, I only see ruby-dev and fpm.

```auto
apt-get install ruby-dev rpm
gem install fpm -v 1.5.0

```

1. Since our build system are really restrict from download outside packages, is there a way to skip download packages from the build commands? And if we skipped, what are the packages we need to pre-download / pre-setup?
2. And is there any commands or options whihch we can use to include the installed plugins in the build files?  
Thanks sooooo much!!

---

<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 6, 2019, 6:35pm UTC](https://discuss.elastic.co/t/kibana-build-error/177904/6 "2019-06-06T18:35:38Z")

</div>

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