I cannot install new palettes in Node-red if the container volume is located on a flash drive, because, npm doesn't have the right permissions to access. Can you help me?
# docker-compose.yml
node-red:
container_name: node-red
image: nodered/node-red:latest
restart: unless-stopped
environment:
- TZ=Europe/Rome
network_mode: "host"
ports:
- "1880:1880"
volumes:
- /media/data/node-red:/data <---- MY USB FLASH DRIVE (FAT32 - vfat)
# - /home/pi/data/node-red:/data. <<-- default place
user: 1000:1000
depends_on:
# - homeassistant
- mosquitto
OS is raspian lite on a pi4 and the usb drive is mount at boot with options:
# /etc/fstab
PARTUUID=af3416fc-01 /media/data vfat auto,rw,user,users,exec,noatime,uid=1000,gui=1000,umask=000 0 0
this is the log file
2020-01-11T13:20:54.190Z Install : node-red-contrib-home-assistant-websocket 0.19.3
2020-01-11T13:20:54.216Z npm install --no-audit --no-update-notifier --save --save-prefix="~" --production node-red-contrib-home-assistant-websocket@0.19.3
2020-01-11T13:21:08.370Z [err] npm
2020-01-11T13:21:08.371Z [err]
2020-01-11T13:21:08.371Z [err] ERR! code EPERM
2020-01-11T13:21:08.372Z [err] npm
2020-01-11T13:21:08.372Z [err] ERR! syscall symlink
2020-01-11T13:21:08.372Z [err] npm ERR! path
2020-01-11T13:21:08.372Z [err] ../flat/cli.js
2020-01-11T13:21:08.372Z [err] npm
2020-01-11T13:21:08.372Z [err] ERR! dest /data/node_modules/.bin/flat
2020-01-11T13:21:08.372Z [err] npm
2020-01-11T13:21:08.373Z [err] ERR! errno -1
2020-01-11T13:21:08.380Z [err] npm
2020-01-11T13:21:08.380Z [err] ERR! Error: EPERM: operation not permitted, symlink '../flat/cli.js' -> '/data/node_modules/.bin/flat'
2020-01-11T13:21:08.380Z [err] npm ERR! { [Error: EPERM: operation not permitted, symlink '../flat/cli.js' -> '/data/node_modules/.bin/flat']
2020-01-11T13:21:08.380Z [err] npm ERR! cause:
2020-01-11T13:21:08.380Z [err] npm
2020-01-11T13:21:08.381Z [err] ERR! { Error: EPERM: operation not permitted, symlink '../flat/cli.js' -> '/data/node_modules/.bin/flat'
2020-01-11T13:21:08.381Z [err] npm ERR!
2020-01-11T13:21:08.381Z [err] errno: -1,
2020-01-11T13:21:08.381Z [err] npm ERR! code: 'EPERM',
2020-01-11T13:21:08.381Z [err] npm ERR! syscall: 'symlink',
2020-01-11T13:21:08.381Z [err] npm
2020-01-11T13:21:08.381Z [err] ERR! path: '../flat/cli.js',
2020-01-11T13:21:08.381Z [err] npm
2020-01-11T13:21:08.381Z [err] ERR! dest: '/data/node_modules/.bin/flat' },
2020-01-11T13:21:08.381Z [err] npm
2020-01-11T13:21:08.381Z [err] ERR! stack:
2020-01-11T13:21:08.381Z [err] npm
2020-01-11T13:21:08.382Z [err] ERR! 'Error: EPERM: operation not permitted, symlink \'../flat/cli.js\' -> \'/data/node_modules/.bin/flat\'',
2020-01-11T13:21:08.382Z [err] npm ERR!
2020-01-11T13:21:08.382Z [err] errno: -1,
2020-01-11T13:21:08.382Z [err] npm ERR!
2020-01-11T13:21:08.382Z [err] code: 'EPERM',
2020-01-11T13:21:08.382Z [err] npm ERR!
2020-01-11T13:21:08.382Z [err] syscall: 'symlink',
2020-01-11T13:21:08.382Z [err] npm ERR!
2020-01-11T13:21:08.382Z [err] path: '../flat/cli.js',
2020-01-11T13:21:08.382Z [err] npm ERR! dest: '/data/node_modules/.bin/flat',
2020-01-11T13:21:08.382Z [err] npm ERR! parent: 'data' }
2020-01-11T13:21:08.383Z [err] npm
2020-01-11T13:21:08.383Z [err] ERR!
2020-01-11T13:21:08.383Z [err] npm ERR! The operation was rejected by your operating system.
2020-01-11T13:21:08.383Z [err] npm ERR! It is likely you do not have the permissions to access this file as the current user
2020-01-11T13:21:08.383Z [err] npm
2020-01-11T13:21:08.383Z [err] ERR!
2020-01-11T13:21:08.383Z [err] npm
2020-01-11T13:21:08.383Z [err] ERR! If you believe this might be a permissions issue, please double-check the
2020-01-11T13:21:08.383Z [err] npm
2020-01-11T13:21:08.383Z [err] ERR! permissions of the file and its containing directories, or try running
2020-01-11T13:21:08.383Z [err] npm ERR!
2020-01-11T13:21:08.383Z [err] the command again as root/Administrator.
2020-01-11T13:21:08.408Z [err]
2020-01-11T13:21:08.409Z [err] npm ERR! A complete log of this run can be found in:
2020-01-11T13:21:08.409Z [err] npm
2020-01-11T13:21:08.409Z [err] ERR! /usr/src/node-red/.npm/_logs/2020-01-11T13_21_08_392Z-debug.log
2020-01-11T13:21:08.423Z rc=255
Edit: add complete /etc/fstab line and npm installation log got from webbrowser
Thanks in advance
It doesn't work because the fat filesystem on the USB stick doesn't support symlinks, which npm is trying to use as part of installing the nodes.
Your best option is to reformat the USB stick to use ext2 (or similar) as the filesystem.