# Kibana: NPM Permission Error at Start

**URL:** <https://discuss.elastic.co/t/kibana-npm-permission-error-at-start/89719>\
**Category:** Kibana\
**Created:** [June 16, 2017, 12:52pm UTC](https://discuss.elastic.co/t/kibana-npm-permission-error-at-start/89719 "2017-06-16T12:52:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ccampbell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ccampbell/32/15320_2.png) [@ccampbell](https://discuss.elastic.co/u/ccampbell)\
**Post date:** [June 16, 2017, 12:52pm UTC](https://discuss.elastic.co/t/kibana-npm-permission-error-at-start/89719/1 "2017-06-16T12:52:20Z")

</div>

I've recently installed Kibana 5.4.1 on 3 new Windows 2012 R2 servers. On the first server, Kibana install went normally, I installed Kibana as a Windows service using NSSM, the service is functioning normally.

On the other two servers, I get the following error when trying to start Kibana as a service:

> Error: EPERM: operation not permitted, open 'D:\Elastic\Kibana\kibana-5.4.1-windows-x86\optimize.babelcache.json'  
> at Error (native)  
> at Object.fs.openSync (fs.js:641:18)  
> at Object.fs.writeFileSync (fs.js:1347:33)  
> at save (D:\Elastic\Kibana\kibana-5.4.1-windows-x86\node\_modules\babel-register\lib\cache.js:45:16)  
> at \_combinedTickCallback (internal/process/next\_tick.js:73:7)  
> at process.\_tickCallback (internal/process/next\_tick.js:104:9)  
> at Module.runMain (module.js:606:11)  
> at run (bootstrap\_node.js:393:7)  
> at startup (bootstrap\_node.js:150:9)  
> at bootstrap\_node.js:508:3  
> fs.js:641  
> return binding.open(pathModule.\_makeLong(path), stringToFlags(flags), mode);

I've seen comments online that I may need to use "NPM clean cache" but I can't figure out how to run that command or verify that the problem is cleared.

Is the NPM cache my problem? If not, where else should I be looking?

---

<div class="post-metadata">

**Author:** ![ppisljar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppisljar/32/11588_2.png) [@ppisljar](https://discuss.elastic.co/u/ppisljar)\
**Post date:** [June 17, 2017, 6:23am UTC](https://discuss.elastic.co/t/kibana-npm-permission-error-at-start/89719/2 "2017-06-17T06:23:03Z")

</div>

not really sure what the problem is, but you could try

`npm clean`  
`npm cache clean`  
and if nothing helps removing the whole folder and trying again ?

---

<div class="post-metadata">

**Author:** ![ccampbell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ccampbell/32/15320_2.png) [@ccampbell](https://discuss.elastic.co/u/ccampbell)\
**Post date:** [June 19, 2017, 10:46am UTC](https://discuss.elastic.co/t/kibana-npm-permission-error-at-start/89719/3 "2017-06-19T10:46:12Z")

</div>

I'm not sure how to invoke "npm clean" and "npm cache clean" - npm doesn't show up in my path or as an executable program, - how do I start it?

---

<div class="post-metadata">

**Author:** ![ppisljar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppisljar/32/11588_2.png) [@ppisljar](https://discuss.elastic.co/u/ppisljar)\
**Post date:** [June 19, 2017, 12:49pm UTC](https://discuss.elastic.co/t/kibana-npm-permission-error-at-start/89719/4 "2017-06-19T12:49:53Z")

</div>

ah sorry, that should not be the problem, you are running production version ...  
looking closer at the error it seems to be a permission problem ? kibana tries to write a file and doens't have permission to do so.

---

<div class="post-metadata">

**Author:** ![ccampbell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ccampbell/32/15320_2.png) [@ccampbell](https://discuss.elastic.co/u/ccampbell)\
**Post date:** [June 20, 2017, 12:57pm UTC](https://discuss.elastic.co/t/kibana-npm-permission-error-at-start/89719/5 "2017-06-20T12:57:24Z")

</div>

Thanks, it was a combination permissions problem for the service account, and an unwritable file.

I solved this problem by changing permissions for the application and data directories, and deleting the **\kibana\optimize.babelcache.json** file. When I restarted the application, the JSON file was created and the application is running correctly.

---

<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:** [July 18, 2017, 1:09pm UTC](https://discuss.elastic.co/t/kibana-npm-permission-error-at-start/89719/6 "2017-07-18T13:09:56Z")

</div>

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