This question already has an answer here:.19 answersI'm having issues with npm in a Vagrant box I'm setting up. I still don't understand why, but I have to run npm install -g npm twice for it to have the desired effect: vagrant@box:$ npm -v1.3.10vagrant@box:$ sudo npm install -g npmnpm http GET http 200 http GET http 200 - /usr/local/lib/nodemodules/npm/bin/[email protected] /usr/local/lib/nodemodules/npmvagrant@box:$ npm -v1.3.10vagrant@box:$ sudo npm install -g npm/usr/bin/npm - /usr/lib/nodemodules/npm/bin/[email protected] /usr/lib/nodemodules/npmvagrant@box:$ npm -v2.1.12.
![]()
When you first do npm install -g npm, the shell (Bash) will search for npm in your path, find /usr/bin/npm installed by the system package, and then use it to install the new version of npm. The new version will be installed in /usr/local/bin/npm.Now, your path should have /usr/local/bin/ BEFORE /usr/bin/, so you would think it would now pick up the updated version in /usr/local/bin/, right? Wrong.Bash will CACHE executable paths after the first time it searches for them, so when you say npm the 2nd time, it is still using the cached version which it first found as /usr/bin/npm.To tell Bash to clear this cache and look through the path again, you have to do a hash -r.After installing npm and doing this, my shell picked up the new version of npm just fine.Thanks. You can update nodejs by using npm itself, a PPA, or manually.npm:Check the current version you have: node -vThe following clears your cache. Sudo npm cache clean -fInstall n sudo npm install -g nYou can tell it to install a specific version like so: sudo n 0.8.11Or just tell it to install the latest stable version. Both may take a while. Inter audio apps for garageband download. Sudo n stableTo see if it actually upgraded, run: node -vPPA:Other option is to install it via a; sudo add-apt-repository ppa:chris-lea/node.jssudo apt-get updatesudo apt-get install nodejsThis PPA Supports the following distros: Utopic (14.10), Trusty (14.04), Saucy (13.10), Raring (13.04), Quantal (12.10), Precise (12.04), Oneiric (11.10), Natty (11.04), Lucid (10.04).Manually:You can always update it by manually the latest version and installing it yourself!Reference:.
How To Install Npm Using Cmd
I was facing the problem. My current npm version was 3.3.12 but I tried sudo npm install npm -g, sudo npm update npm -g. Nothing worked. While I npm -version I always get 3.3.12. I searched for directories in my Ubuntu 15.04 and found two version of npm in different directory.
![]()
v3.3.12 in /usr/local/lib/nodemodules/npm. v3.6 in /usr/lib/nodemodules/npmSo I did make a copy of 3.3.12 with mv npm npm3312 while I was in older npm directory.
Then I did sudo cp -r npm /usr/local/lib/nodemodules/ while I was in '/usr/lib/nodemodules' directory. Portal 2 alternate ending. I made my npm -version and I got 3.6.0:D.
Install Via Npm
A question we get asked often is “what’s the best, npm-recommended way of installing npm?” Weirdly, there are no good, recent sources for this. I’m going to fix that on the main site, but I thought I’d post quickly here.The best way to install npm is to install node using.
Npm Help Install
Npm is installed as part of node.It’s over at. It will give you a recent, working version of npm with all the paths in the expected places. This is the version that npm Inc and the Node.js project both support.Once you’ve installed Node.js, you can make sure you’ve got the very most recent version of npm using npm itself:sudo npm install npm -g(on Windows, you can drop the “sudo” but you should run it as administrator).
Running this update will give you the most recent stable version of npm, also supported by npm Inc.Obviously, no matter how you install npm, we’ll do our best to make sure it works for you, but if you installed it some other way, you should try this recommended way first.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |