Unable to install modules on Docker

Hello, I recently tried to update some nodes via the manage palette menu, that failed and since I've been unable to install any new nodes, and some of the ones I attempted to update have disappeared.

I'm running node-red in a docker container on a raspberry pi 4, I've checked permissions and all seems fine there. I get the following message in the logs

1950 verbose stack Error: EPERM: operation not permitted, symlink '../multicast-dns/cli.js' -> '/data/node_modules/.bin/multicast-dns'
1951 verbose cwd /data
1952 verbose Linux 5.10.63-v7l+
1953 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--no-audit" "--no-update-notifier" "--no-fund" "--save" "--save-prefix=~" "--production" "--engine-strict" "node-red-contrib-home-assistant-websocket@0.41.3"
1954 verbose node v14.18.2
1955 verbose npm  v6.14.15
1956 error code EPERM
1957 error syscall symlink
1958 error path ../multicast-dns/cli.js
1959 error dest /data/node_modules/.bin/multicast-dns
1960 error errno -1
1961 error Error: EPERM: operation not permitted, symlink '../multicast-dns/cli.js' -> '/data/node_modules/.bin/multicast-dns'
1961 error  [OperationalError: EPERM: operation not permitted, symlink '../multicast-dns/cli.js' -> '/data/node_modules/.bin/multicast-dns'] {
1961 error   cause: [Error: EPERM: operation not permitted, symlink '../multicast-dns/cli.js' -> '/data/node_modules/.bin/multicast-dns'] {
1961 error     errno: -1,
1961 error     code: 'EPERM',
1961 error     syscall: 'symlink',
1961 error     path: '../multicast-dns/cli.js',
1961 error     dest: '/data/node_modules/.bin/multicast-dns'
1961 error   },
1961 error   errno: -1,
1961 error   code: 'EPERM',
1961 error   syscall: 'symlink',
1961 error   path: '../multicast-dns/cli.js',
1961 error   dest: '/data/node_modules/.bin/multicast-dns',
1961 error   parent: 'data'
1961 error }
1962 error The operation was rejected by your operating system.
1962 error It is likely you do not have the permissions to access this file as the current user
1962 error
1962 error If you believe this might be a permissions issue, please double-check the
1962 error permissions of the file and its containing directories, or try running
1962 error the command again as root/Administrator.
1963 verbose exit [ -1, true ]

Here is the rest of the log, but I don't think there's anything relevant in it - https://textbin.net/obgntuhymu

I appreciate any help, please let me know if further info would be helpful, thank you.

Are you using Docker for a good reason? If not then don't, it just adds complexity. Instead, install node red using the recommended script. Running on Raspberry Pi : Node-RED

If you do need to do it, it seems you have a permissions problem of some sort. Possibly with /data.

No, I'm running other stuff in Docker so it was just to keep it the same. Looking through the forum it does seem like it causes a lot of issues, I'll install it directly so, thanks for replying.

Docker is great if you just need to install something and run it. The problems arise when you need to tweak it. Then you need to understand what you are doing, and there are not all that many who can help when things go wrong.

I assume you are using some volume mapping? is the underlying folder it owned by the same user that is running the container?

I suspect that is where the problem lies.

this is how I run mine (docker-compose):


---
version: "2.1"
services:
  nodered:
    network_mode: bridge
    image: nodered/node-red
    container_name: nodered
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Amsterdam
    volumes:
      - /media/dockervolumes/nodered/noderedData:/data
    ports:
      - 1880:1880
    restart: unless-stopped

and the /media/dockervolumes/nodered folder is owned by user 1000 (chown 1000:1000 /media/dockervolumes/nodered -R)

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