0
votes

I am trying to install vue cli on my ubuntu os.....and i can t because of some errors....and i have npm version 6.13.4 ....idk why it says that i have 2.6.11...i have already tried to delete cache and node modules and npm install again....but it doesn t work....any help, pls?

npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3. /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/2575/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/babel-polyfill/node_modules/core-js node -e "try{require('./postinstall')}catch(e){}"

2020/01/02 01:50:38.033096 cmd_run.go:884: WARNING: cannot create user data directory: cannot create "/nonexistent/snap/node/2575": mkdir /nonexistent: permission denied cannot create user data directory: /nonexistent/snap/node/2575: Permission denied npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/@vue/cli/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 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-01-01T23_50_41_447Z-debug.log

2

2 Answers

0
votes
sudo npm update -g core-js@latest
sudo npm update -g fsevents@latest
0
votes

i have npm version 6.13.4 ....idk why it says that i have 2.6.11

This makes me a little nervous. You should be able to run which npm to figure out where the 2.6.11 version is coming from. But with that said it may not be worth your time to investigate.

At the risk of sending you down a rabbit hole I would suggest Node Version Manager(NVM): https://github.com/nvm-sh/nvm. Pretty basic, NVM will let you set a definitive version of Node and NPM. To get started just:

  1. Copy and run this (from the readme) curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
  2. Run nvm install stable. That should download and install the latest stable version of Node and NPM.
  3. Probably safe to run npm cache clean to get to a cleaner slate.

From there I'd re-try your cli install: npm install -g @vue/cli following the steps here: https://cli.vuejs.org/guide/installation.html