Permission Denied on npm i during node-pre-gyp install
Maaster opened this issue · comments
Maaster commented
Hey, probably some stupid mistake but I cant figure it out.
It worked fine for several weeks, then I decided to upgrade and pull the latest changes with npm i and it threw this:
root@maaster-VirtualBox:~/flowabot# npm i
> canvas@2.6.0 install /root/flowabot/node_modules/canvas
> node-pre-gyp install --fallback-to-build
fs.js:115
throw err;
^
Error: EACCES: permission denied, open '/root/flowabot/node_modules/canvas/package.json'
at Object.openSync (fs.js:439:3)
at Object.readFileSync (fs.js:344:35)
at Run.parseOpts [as parseArgv] (/usr/lib/node_modules/node-pre-gyp/lib/node-pre-gyp.js:136:36)
at Object.<anonymous> (/usr/lib/node_modules/node-pre-gyp/bin/node-pre-gyp:24:6)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
npm WARN discord.js@11.5.1 requires a peer of @discordjs/uws@^10.149.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.5.1 requires a peer of bufferutil@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.5.1 requires a peer of erlpack@discordapp/erlpack but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.5.1 requires a peer of libsodium-wrappers@^0.7.3 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.5.1 requires a peer of node-opus@^0.2.7 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.5.1 requires a peer of opusscript@^0.0.6 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.5.1 requires a peer of sodium@^2.0.3 but none is installed. You must install peer dependencies yourself.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas@2.6.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@2.6.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-10-22T21_11_51_188Z-debug.log
node -v return v10.16.0
What am I missing?
LeaPhant commented
Weird, does it work if you run sudo npm i
? Otherwise you could try removing node_modules with sudo rm -rf ./node_modules
and then redoing npm i
Maaster commented
Interesting. sudo npm i
works.
I thought running sudo -i
beforehand would automatically run everything as root? Linux continues to confuse me.
Anyway, thanks!