# Npm ERR! code ELIFECYCLE. Docker install

**URL:** <https://discourse.nodered.org/t/npm-err-code-elifecycle-docker-install/63075>\
**Category:** General\
**Tags:** docker\
**Created:** [25 May 2022 21:09 UTC](https://discourse.nodered.org/t/npm-err-code-elifecycle-docker-install/63075 "2022-05-25T21:09:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![catch4](https://avatars.discourse-cdn.com/v4/letter/c/e8c25b/32.png) [@catch4](https://discourse.nodered.org/u/catch4)\
**Post date:** [25 May 2022 21:09 UTC](https://discourse.nodered.org/t/npm-err-code-elifecycle-docker-install/63075/1 "2022-05-25T21:09:14Z")

</div>

Hello,

I'm trying to install nodered to work with Home-Assistant on an ubuntu server, but can't seem to get it to work. I'm using docker compose to create a nodered container, here is my compose text:

```auto
> node-red:
> image: nodered/node-red:latest
> container_name: nodered
> environment:
> - TZ=$TZ
> - PUID=$PUID
> - PGID=$PGID
> ports:
> - "1880:1880"
> volumes:
> - my-data-folder:/data
> restart: unless-stopped

```

I checked the logs in portainer and this are the errors I see:

> "Error: EACCES: permission denied, **copyfile '/usr/src/node-red/node\_modules/node-red/settings.js**' -\> '/data/settings.js'  
> at Object.copyFileSync (fs.js:2061:3)  
> at copyFile (/usr/src/node-red/node\_modules/fs-extra/lib/copy-sync/copy-sync.js:70:6)  
> at onFile (/usr/src/node-red/node\_modules/fs-extra/lib/copy-sync/copy-sync.js:56:25)  
> at getStats (/usr/src/node-red/node\_modules/fs-extra/lib/copy-sync/copy-sync.js:48:44)  
> at handleFilterAndCopy (/usr/src/node-red/node\_modules/fs-extra/lib/copy-sync/copy-sync.js:33:10)  
> at Object.copySync (/usr/src/node-red/node\_modules/fs-extra/lib/copy-sync/copy-sync.js:26:10)  
> at Object. (/usr/src/node-red/node\_modules/node-red/red.js:125:20)  
> at Module.\_compile (internal/modules/cjs/loader.js:1085:14)  
> at Object.Module.\_extensions..js (internal/modules/cjs/loader.js:1114:10)  
> at Module.load (internal/modules/cjs/loader.js:950:32) {  
> errno: -13,  
> syscall: 'copyfile',  
> code: 'EACCES',  
> path: '/usr/src/node-red/node\_modules/node-red/settings.js',  
> dest: '/data/settings.js'  
> }  
> npm ERR! code ELIFECYCLE  
> npm ERR! errno 1  
> npm ERR! node-red-docker@2.2.2 start: `node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"`  
> npm ERR! Exit status 1"  
> npm ERR! Failed at the node-red-docker@2.2.2 start script.  
> npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I do not have the file: **/usr/src/node-red/node\_modules/node-red/settings.js**. There is no usr/src/node-red folder at all. Is this something I have to manually create?

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [25 May 2022 22:36 UTC](https://discourse.nodered.org/t/npm-err-code-elifecycle-docker-install/63075/2 "2022-05-25T22:36:11Z")

</div>

> [@catch4](#):
>
> `- my-data-folder:/data`

This should be an absolute or relative path. When you launch the container, it tries to copy the `settings.js` file there. If this path does not exist or you do not have the correct permissions, you will get this error.

---

<div class="post-metadata">

**Author:** ![catch4](https://avatars.discourse-cdn.com/v4/letter/c/e8c25b/32.png) [@catch4](https://discourse.nodered.org/u/catch4)\
**Post date:** [26 May 2022 23:49 UTC](https://discourse.nodered.org/t/npm-err-code-elifecycle-docker-install/63075/3 "2022-05-26T23:49:44Z")

</div>

hmm, weird, when i ran the docker-compose up, it created the folder (my data folder is in /opt/docker/nodered) but there is only a data folder there and nothing else, so the path i see is: /opt/docker/nodered/data/  
I'll look further into permissions, the docker group (PGID) should have the correct permissions for the /opt folder and its subdirectories; i haven't had any issues spinning up containers this way in the past.

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [25 July 2022 23:50 UTC](https://discourse.nodered.org/t/npm-err-code-elifecycle-docker-install/63075/4 "2022-07-25T23:50:08Z")

</div>

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