0

I installed Node.js using Snap on my Parrot OS system.

I don't know why, but I don't have the node_modules folder after /usr/local/lib

This is the error I get with npm install -g @vue/cli

npm WARN deprecated @hapi/[email protected]: joi is leaving the @hapi organization and moving back to 'joi' (https://github.com/sideway/joi/issues/2411)
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
/usr/local/bin/vue -> /usr/local/lib/node_modules/@vue/cli/bin/vue.js
npm WARN lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/2913/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> [email protected] postinstall /usr/local/lib/node_modules/@vue/cli/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

2020/08/12 15:51:38.149740 cmd_run.go:918: WARNING: cannot create user data directory: cannot create "/nonexistent/snap/node/2913": mkdir /nonexistent: permission denied
cannot create user data directory: /nonexistent/snap/node/2913: Permission denied
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/@vue/cli/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN @vue/[email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node -e "try{require('./postinstall')}catch(e){}"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall 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/2020-08-12T10_21_41_518Z-debug.log

edit :-

while using sudo i get the following error - sudo: npm: command not found. So I ran su first, then tried npm install -g @vue/cli but then i get the error originally asked in the question.

0

1 Answer 1

1

When you install npm packages globally, you have to run the install command as administrator.

try to run,

sudo npm install -g @vue/cli

Sign up to request clarification or add additional context in comments.

3 Comments

I tried that command, but it says - sudo: npm: command not found.
It got solved i did a sudo apt-get install npm. For some reason the npm came with Node.js isn't doing the thing so i had to install npm seperately.
Thanks @AswinHaridas. This (installing separate npm) resolved it (different package and error) for me as well.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.