# (solved) Node-Red docker using another uid: error on adding packages

**URL:** <https://discourse.nodered.org/t/solved-node-red-docker-using-another-uid-error-on-adding-packages/7312>\
**Category:** General\
**Created:** [27 January 2019 17:53 UTC](https://discourse.nodered.org/t/solved-node-red-docker-using-another-uid-error-on-adding-packages/7312 "2019-01-27T17:53:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![IoTPlay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iotplay/32/40_2.png) [@IoTPlay](https://discourse.nodered.org/u/IoTPlay)\
**Post date:** [27 January 2019 17:53 UTC](https://discourse.nodered.org/t/solved-node-red-docker-using-another-uid-error-on-adding-packages/7312/1 "2019-01-27T17:53:35Z")

</div>

Hi, fired up a rpi, added docker. I deleted "pi" uid (sec reasons), added user "node-red" (uid = 1001), and group "node-red" (uid = 10050). The official node-red docker instructions warns when you delete use 1000, that you should start node-red with the `--user` command, and yes - I experienced this. So, the command that get docker node-red started properly looks like this:

```
docker run -it -p 1880:1880 --user=node-red:node-red -v /home/node-red/iotplay/rhm_dig2/data:/data --name testdock nodered/node-red-docker:rpi-v8

```

... of which the folder `/home/node-red/iotplay/rhm_dig2/data` have been created by user & group `node-red` ...

All good..... so far. But, when I try to add a package (like node-red-dashboard), I get the following error, inside the docker logs of node-red:

```
┌──────────────────────────────────────────────┐
│ npm update check failed │
│ Try running with sudo or get access │
│ to the local update config store via │
│ sudo chown -R $USER:$(id -gn $USER) /.config │
└──────────────────────────────────────────────┘

```

Further errors in the `npm-debug.log` file, shows the following errors, obviously a rights & access issue:

```
80 error Linux 4.14.79-v7+
81 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save" "--save-prefix=~" "--production" "node-red-dashboard@2.13.0"
82 error node v6.11.0
83 error npm v3.10.10
84 error path /.npm
85 error code EACCES
86 error errno -13
87 error syscall mkdir
88 error Error: EACCES: permission denied, mkdir '/.npm'
88 error at Error (native)
88 error { Error: EACCES: permission denied, mkdir '/.npm'
88 error at Error (native)
88 error errno: -13,
88 error code: 'EACCES',
88 error syscall: 'mkdir',
88 error path: '/.npm',
88 error parent: 'node-red-project' }
89 error Please try running this command again as root/Administrator.

```

The error occurs with both node versions v8 and v6 on RPi.

I previously ran this type of config successfully.

---

<div class="post-metadata">

**Author:** ![IoTPlay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iotplay/32/40_2.png) [@IoTPlay](https://discourse.nodered.org/u/IoTPlay)\
**Post date:** [27 January 2019 19:07 UTC](https://discourse.nodered.org/t/solved-node-red-docker-using-another-uid-error-on-adding-packages/7312/2 "2019-01-27T19:07:53Z")

</div>

An update, running as root allows installation, thus I now need to go find what about the user is causing this...

The following works:

```
docker run -it -p 1880:1880 --user=root:root -v /home/node-red/iotplay/rhm_dig2/data:/data/ --name testdock nodered/node-red-docker:rpi-v6
```

---

<div class="post-metadata">

**Author:** ![IoTPlay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iotplay/32/40_2.png) [@IoTPlay](https://discourse.nodered.org/u/IoTPlay)\
**Post date:** [27 January 2019 20:13 UTC](https://discourse.nodered.org/t/solved-node-red-docker-using-another-uid-error-on-adding-packages/7312/3 "2019-01-27T20:13:30Z")

</div>

Okay, this command `chmod -R a+rw \data` solves the problem. Got it [here](https://github.com/samtecspg/node-red-tutorials/issues/1#issuecomment-391372040)
