Node.js fundamentals: how to upgrade the Node.js version

[From]: http://theholmesoffice.com/node-js-fundamentals-how-to-upgrade-the-node-js-version/

Node.js is being actively developed, and the latest stable version frequently changes. From time to time you will find a module that doesn’t work with your current version of Node and says that you need to upgrade.

Fortunately there is a very easy way of managing your node version, using the Node binary manager module ‘n’.

1: Check your current version of Node.

$node -v v0.6.12

2: Clear your npm cache

sudo npm cache clean -f  

3: Install ‘n’

sudo npm install -g n  

4: Upgrade to a later version (this step can take a while) You can specify a particular version like so:

sudo n 0.8.11  

Or you can just tell the manager to install the latest stable version like so:

sudo n stable  

5: Check the running version of Node to verify that it has worked:

$node -v v0.8.11

If the version doesn’t number output in step 5 isn’t what you were expecting, you may need to reboot.

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