Hi all
Keep it short, here is the error I got:
As you can see, I am using sudo npm install --production
, but it still shows Permission denied
.
alucard@chatbot:/home/alucard/node-red/node-red-0.19.5$ sudo npm install --production
npm WARN deprecated formatio@1.1.1: This package is unmaintained. Use @sinonjs/formatio instead
npm WARN deprecated mailparser@0.6.2: Mailparser versions older than v2.3.0 are deprecated
npm WARN deprecated nodemailer@1.11.0: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
npm WARN deprecated nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info.
npm WARN deprecated mimelib@0.3.1: This project is unmaintained
npm WARN deprecated mailcomposer@2.1.0: This project is unmaintained
npm WARN deprecated buildmail@2.0.0: This project is unmaintained
> bcrypt@2.0.1 install /home/alucard/node-red/node-red-0.19.5/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Pre-built binaries not installable for bcrypt@2.0.1 and node@11.1.0 (node-v67 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Hit error EACCES: permission denied, mkdir '/home/alucard/node-red/node-red-0.19.5/node_modules/bcrypt/lib'
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/11.1.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/alucard/node-red/node-red-0.19.5/node_modules/bcrypt/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/alucard/node-red/node-red-0.19.5/node_modules/bcrypt/.node-gyp'
gyp ERR! System Linux 4.15.0-38-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/alucard/node-red/node-red-0.19.5/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/home/alucard/node-red/node-red-0.19.5/node_modules/bcrypt/lib/binding" "--napi_version=3" "--node_abi_napi=napi"
gyp ERR! cwd /home/alucard/node-red/node-red-0.19.5/node_modules/bcrypt
gyp ERR! node -v v11.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/alucard/node-red/node-red-0.19.5/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/home/alucard/node-red/node-red-0.19.5/node_modules/bcrypt/lib/binding --napi_version=3 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/alucard/node-red/node-red-0.19.5/node_modules/bcrypt/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:970:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:257:5)
node-pre-gyp ERR! System Linux 4.15.0-38-generic
node-pre-gyp ERR! command "/usr/bin/node" "/home/alucard/node-red/node-red-0.19.5/node_modules/bcrypt/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/alucard/node-red/node-red-0.19.5/node_modules/bcrypt
node-pre-gyp ERR! node -v v11.1.0
node-pre-gyp ERR! node-pre-gyp -v v0.9.1
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/alucard/node-red/node-red-0.19.5/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/home/alucard/node-red/node-red-0.19.5/node_modules/bcrypt/lib/binding --napi_version=3 --node_abi_napi=napi' (1)
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN node-red-node-test-helper@0.1.7 requires a peer of node-red@~0.18.4 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: bcrypt@2.0.1 (node_modules/bcrypt):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: bcrypt@2.0.1 install: `node-pre-gyp install --fallback-to-build`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
added 319 packages from 314 contributors and audited 6871 packages in 30.197s
found 1 low severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
And no matter I run sudo npm install -g --unsafe-perm node-red
or downloading source, when I run node-red
, I got:
alucard@chatbot:/home/alucard/node-red/node-red-0.19.5$ node-red
path.js:39
throw new ERR_INVALID_ARG_TYPE('path', 'string', path);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
at assertPath (path.js:39:11)
at Object.join (path.js:1155:7)
at Object.<anonymous> (/usr/local/lib/node_modules/node-red/red.js:94:50)
at Module._compile (internal/modules/cjs/loader.js:707:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
at Module.load (internal/modules/cjs/loader.js:605:32)
at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
at Function.Module._load (internal/modules/cjs/loader.js:536:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:760:12)
at startup (internal/bootstrap/node.js:308:19)
node -v: v11.1.0
npm -v: 6.4.1
Ubuntu: 18.04.
Hope someone can help me.
Thank you very much in advance for your help.