Permission denied installing npm packages

After executing framework7 create i got this:


Searching on npm logs I found this:

415 warn lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/2497/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
416 verbose stack Error: EACCES: permission denied, write
416 verbose stack     at writeSync (fs.js:588:3)
416 verbose stack     at SyncWriteStream._write (internal/fs/sync_write_stream.js:22:3)
416 verbose stack     at doWrite (_stream_writable.js:418:12)
416 verbose stack     at writeOrBuffer (_stream_writable.js:402:5)
416 verbose stack     at SyncWriteStream.Writable.write (_stream_writable.js:302:11)
416 verbose stack     at EventEmitter.log.write (/usr/local/lib/node_modules/npm/node_modules/npmlog/log.js:271:10)
416 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npmlog/log.js:234:12)
416 verbose stack     at Array.forEach (<anonymous>)
416 verbose stack     at EventEmitter.log.emitLog (/usr/local/lib/node_modules/npm/node_modules/npmlog/log.js:232:28)
416 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npmlog/log.js:214:8)
416 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npmlog/log.js:286:23)
416 verbose stack     at shouldPrependCurrentNodeDirToPATH (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:196:18)
416 verbose stack     at lifecycle_ (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:132:7)
416 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:104:9
416 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:218:12
416 verbose stack     at callback (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:289:20)
417 verbose cwd /home/vendramini/Studies/framework7/myapp

Everything I’m doing is inside ~/Studies/framework7, so I do have permission for. All folders are owned by me.

Any ideas?

Thank you.

run cmd as admin
or sudo if linux

But why if I’m inside my home folder? BTW, I’m following the official tutorial and doesn’t tells me to use sudo. If I do with sudo, all files will be created owned by root and this could brings me others problems during development, couldn’t? I’m on Linux Mint 19.2.

i use windows, did it with cmd as admin and after that never had a permission problem with f7-cli

I tried now with sudo and gives me the same permission problem, lol.

If some Linux user is reading this, please help.

Also, thanks for your attention, @pvtallulah.

https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally
pls delete folder node_modules and try again and read the link

1 Like