[NodeJS] upgrade NodeJS with npm

Normally, it is a little boring to generate versions. Today I want to install sails.js, when I do “sudo npm -g install sails”, it displays several WARN in red, don’t be afraid, there are some command to upgrade your node with npm to the last version or the version that you want.

sudo npm cache clean -f   # Clear your npm cache
sudo npm install -g n     # Install "n" which is node binary module
sudo n stable

you could specify a desired version:

sudo n 0.8.21
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s