node -v: v8.10.0
npm -v: 3.5.2
While running npm install -g #vue/cli or sudo npm install -g #vue/cli I get the error below and failed to download Vue CLI
You are using a rather old version of npm. The current version is 6.9.0, and the packages you are working with are asking for npm >= 5.5.1.
You need to update your node version, if possible always use latest node version
Nodejs version 14.4.
And if you have project that required different node version then use
NVM - node version manager
Just use sudo for global install
sudo npm install -g #vue/cli
Related
I have tried running npm i -g gatsby-cli and sudo npm i -g gatsby-cli but when I run gatsby --version it still says 2.12.78 even though it also says "Update available 2.12.78 → 3.10.0 | Run npm i -g gatsby-cli to update"
These are my package versions:
npm version: 7.19.1
node version: v16.5.0
Gatsby CLI version: 2.12.78
You just need to follow the migration guide:
npm install gatsby#latest
All gatsby-* should be upgraded too, but without updating the global Gatsby package you can't update the related ones. Check them by:
npm outdated
According to this page:
https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
it says:
To publish and install packages to and from the public npm registry or
your company's npm Enterprise registry, you must install Node.js and
the npm command line interface using either a Node version manager or
a Node installer.
Then gives npm install -g npm which won't work cos npm isn't installed.
nvm doesn't work:
nvm install npm
Version 'npm' not found - try `nvm ls-remote` to browse available versions.
Clicking on the nvm link takes you to the nvm GitHub page.
Half way down I found this:
nvm install-latest-npm
which fails with:
nvm install-latest-npm
Attempting to upgrade to the latest working version of npm...
Unable to obtain npm version.
Any suggestions?
nvm is for installing node not npm, npm will be installed
What you're doing with nvm install npm, is attempting to install a node version called npm.
Do nvm install 14, let it run, check for errors, then once installed your have npm.
Just run these scripts and you are good to go.
sudo apt update
sudo apt install nodejs
It installs nodejs as well as npm.
I believe that all node versions are going to install a definite version of npm on your system - there is a 1 to 1 relationship between the node version and a npm version.
I am using nvm to install custom versions of node.
But how can I install a version of npm which is not the one - that is bundled with that version of node.
nvm install 8.17.0
nvm use 8.17.0
the npm version with it is 6.13.4 - But I want to use npm version of 5.6
How can I do that?
Is it possible to find the npm version which comes with various node versions?
Basically for installing the latest npm version is
npm install npm#latest
but how to do this
npm install npm#5.6
Got the answer:
npm install npm#5.6.0 -g
I'm trying to install angular via ubuntu.
When I type the version commande node -v
I get v12.14.1
Then I try to install npm package sudo npm install -g #angular/cli
I get a warning
npm WARN npm npm does not support Node.js v10.15.2
ng version
I get angular-cli: 1.0.0-beta.28.3
The npm version is 6.13.4
The issue here seems to be that sudo node -v gives 10.15.2 where as node -v gives 12.14.1.
This means that there are 2 different node versions installed.
You can get around this by using sudo -E node -v or by deleting the link to the other node.js install by doing: rm /usr/local/bin/node.
I had a makeshift setup on Lubuntu that 'functioned' with sudo npm install. I used Ionic Framework generator to create projects and they functioned as well as the builds and deployment.
I upgraded to 15.04 and ever since had problems finding a solution that worked does not give EACCESS errors or grunt serve telling me
Upgrade warning - for the CLI to run correctly,
it is highly suggested to upgrade the following:
Please update your Node runtime to version >=0.12.x
Please update your Cordova CLI to version >=4.2.0 npm install -g cordova
then for npm install -g cordova to tell me
npm WARN engine cordova-serve#0.1.3: wanted: {"node":">= 0.12.0","npm":">= 2.5.1"} (current: {"node":"0.10.26","npm":"2.12.1"})
I have tried the "chown -R whoami /dir/of/npm"
I have delete npm, node install brew and created new installs for all.
I still get EACCESS errors, my yo ionic "grunt serve" deploys the browser but gives ERR_CONNECTION_REFUSED
I installed brew, manually deleted the npm folder and did a clean install. No joy
which node - /home/username/.nvm/v0.10.26/bin/node
node -v v0.10.26
which npm - /home/userna/.linuxbrew/bin/npm
npm -v 2.12.1
which cordova - /usr/local/bin/cordova
cordova -v 3.5.0-0.2.6
And for good meassure i thought if i installed node4 all my troubles would disappear.
I know i messed this up but i would like a clean start with node, npm(without sudo) and cordova. Any help would be appreciated
Ps: I have done most of the normal suggestions hence my question.
Did you installed node using nvm?
So try
nvm use 4.0.0
In general:
nvm install [VERSION]
nvm use [VERSION]
To use permanent:
nvm alias default [VERSION]
try also to install cordova again after updating node
npm install -g cordova
If all fails:
Uninstall node and reinstall propper using brew:
cd ~
sudo rm -rf .npm
brew update
brew uninstall npm
brew install npm