# Unable to install modules - permission denied

**URL:** <https://discourse.nodered.org/t/unable-to-install-modules-permission-denied/70804>\
**Category:** General\
**Created:** [18 November 2022 00:58 UTC](https://discourse.nodered.org/t/unable-to-install-modules-permission-denied/70804 "2022-11-18T00:58:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ccheese4](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@Ccheese4](https://discourse.nodered.org/u/Ccheese4)\
**Post date:** [18 November 2022 00:58 UTC](https://discourse.nodered.org/t/unable-to-install-modules-permission-denied/70804/1 "2022-11-18T00:58:54Z")

</div>

I have attempted to install two modules recently. node-red-contrib-sun-position, and node-red-dashboard. Both have failed due to the same error. Here is the output from my log file:

```auto
2022-11-18T00:50:37.753Z Install : node-red-dashboard 3.2.0

2022-11-18T00:50:38.072Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-dashboard@3.2.0
2022-11-18T00:50:44.200Z [err] npm
2022-11-18T00:50:44.200Z [err] WARN locking Error: EACCES: permission denied, open '/data/.npm/_locks/staging-accc372ed0ccb0d8.lock'
2022-11-18T00:50:44.200Z [err] npm WARN locking /data/.npm/_locks/staging-accc372ed0ccb0d8.lock failed [Error: EACCES: permission denied, open '/data/.npm/_locks/staging-accc372ed0ccb0d8.lock'] {
2022-11-18T00:50:44.200Z [err] npm WARN locking errno: -13,
2022-11-18T00:50:44.200Z [err] npm WARN locking code: 'EACCES',
2022-11-18T00:50:44.200Z [err] npm WARN locking syscall: 'open',
2022-11-18T00:50:44.200Z [err] npm WARN locking path: '/data/.npm/_locks/staging-accc372ed0ccb0d8.lock'
2022-11-18T00:50:44.200Z [err] npm WARN locking }
2022-11-18T00:50:44.264Z [err] npm ERR! code
2022-11-18T00:50:44.265Z [err] EACCES
2022-11-18T00:50:44.265Z [err] npm ERR! syscall open
2022-11-18T00:50:44.265Z [err] npm ERR! path /data/.npm/_locks/staging-accc372ed0ccb0d8.lock
2022-11-18T00:50:44.265Z [err] npm ERR! errno
2022-11-18T00:50:44.265Z [err] -13
2022-11-18T00:50:44.266Z [err] npm ERR! 
2022-11-18T00:50:44.266Z [err] npm
2022-11-18T00:50:44.266Z [err] ERR! Your cache folder contains root-owned files, due to a bug in
2022-11-18T00:50:44.266Z [err] npm ERR! previous versions of npm which has since been addressed.
2022-11-18T00:50:44.266Z [err] npm 
2022-11-18T00:50:44.266Z [err] ERR! 
2022-11-18T00:50:44.266Z [err] npm ERR! To permanently fix this problem, please run:
2022-11-18T00:50:44.266Z [err] npm
2022-11-18T00:50:44.266Z [err] ERR! sudo chown -R 1000:1000 "/data/.npm"
2022-11-18T00:50:44.279Z [err] 
2022-11-18T00:50:44.279Z [err] npm ERR! A complete log of this run can be found in:
2022-11-18T00:50:44.279Z [err] npm ERR! /data/.npm/_logs/2022-11-18T00_50_44_268Z-debug.log
2022-11-18T00:50:44.288Z rc=243

```

I have attempted to run the `sudo chown -R 1000:1000 "/data/.npm"` command recommended in the log file with no success. I attempted to run it from the Unraid NodeRed docker console, and got `sh: sudo: not found`. If I run it without sudo, I get `chown: /data/.npm/_locks: Operation not permitted`.

I am running Node-RED v2.0.0-beta.1 in a docker container on my Unraid server. I only use it to interface with a Home Assistant instance running in a separate VM. I have previously been able to install modules, but it's been a couple months since I last attempted to do so. Does anyone know how to fix this error?

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:** [17 January 2023 00:59 UTC](https://discourse.nodered.org/t/unable-to-install-modules-permission-denied/70804/2 "2023-01-17T00:59:20Z")

</div>

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