I followed the above post. and using the below command to create another Node-RED instance.
node-red -u /node-red-1881 -p 1881
But got an error
node:internal/fs/utils:347
throw err;
^Error: EACCES: permission denied, mkdir '/node-red-1881'
at Object.mkdirSync (node:fs:1382:3)
at module.exports.makeDirSync (/usr/lib/node_modules/node-red/node_modules/fs-extra/lib/mkdirs/make-dir.js:23:13)
at handleFilterAndCopy (/usr/lib/node_modules/node-red/node_modules/fs-extra/lib/copy/copy-sync.js:35:35)
at Object.copySync (/usr/lib/node_modules/node-red/node_modules/fs-extra/lib/copy/copy-sync.js:29:10)
at Object. (/usr/lib/node_modules/node-red/red.js:129:20)
at Module._compile (node:internal/modules/cjs/loader:1155:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
at Module.load (node:internal/modules/cjs/loader:1033:32)
at Function.Module._load (node:internal/modules/cjs/loader:868:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
errno: -13,
syscall: 'mkdir',
code: 'EACCES',
path: '/node-red-1881'
}
So I googled and found several links one of which is this LINK
which said run this to fix
$ sudo npm install --unsafe-perm=true --allow-root
but no resolve then I googled some more and did the following
- npm cache clean (got error )
npm ERR! As of npm@5, the npm cache self-heals from corruption issues
npm ERR! by treating integrity mismatches as cache misses. As a result,
npm ERR! data extracted from the cache is guaranteed to be valid. If you
npm ERR! want to make sure everything is consistent, usenpm cache verify
npm ERR! instead. Deleting the cache can only make npm go slower, and is
npm ERR! not likely to correct any problems you may be encountering!
npm ERR!
npm ERR! On the other hand, if you're debugging an issue with the installer,
npm ERR! or race conditions that depend on the timing of writing to an empty
npm ERR! cache, you can usenpm install --cache /tmp/empty-cache
to use a
npm ERR! temporary cache instead of nuking the actual one.
npm ERR!
npm ERR! If you're sure you want to delete the entire cache, rerun this command
npm ERR! with --force.npm ERR! A complete log of this run can be found in:
npm ERR! /home/scada/.npm/_logs/2022-12-09T05_16_12_216Z-debug-0.log
- npm cache clean --force
- sudo npm install -g npm
- npm install (got error again )
npm ERR! code EACCES
npm ERR! syscall open
npm ERR! path /home/scada/package-lock.json
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, open '/home/scada/package-lock.json'
npm ERR! [Error: EACCES: permission denied, open '/home/scada/package-lock.json'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: '/home/scada/package-lock.json'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.npm ERR! A complete log of this run can be found in:
npm ERR! /home/scada/.npm/_logs/2022-12-09T05_18_00_905Z-debug-0.log
Can anyone help me on this. I've no idea how to solve this.