简体   繁体   中英

Updated NPM but still showing as old version

Getting "npm: command not found" on this computer. Only way I knew to get it was by uninstalling node with Homebrew and reinstalling from the node.js site. Just reinstalled node.js on this computer and have npm version 2.5.1 with it. I went to update to the newest (2.7.1) using:

sudo npm install npm -g

Updated without any errors, but running npm -v tells me I'm still on version 2.5.1

In the process of looking into the issue, see that old npm related files are on this computer. Old Changelog last modified 30 days ago exists saying "v2.7.1 (2015-03-05)" so npm was updated and on here at one point.

Can anyone point me in the right direction to figure out what is going wrong?

Making some assumptions here: there isn't anything really wrong, there just might be some installation issues. Homebrew should be just fine for installing node, Thoughtbot uses it to set-up laptops (see here ).

To make sure Node/NPM installation is done in a smooth way, I did this:

sudo chown -R $USER /usr/local

Per this post.

I am on Yosemite and I haven't had any issues using this set-up, especially when updating NPM (did it when I read your question).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM