Keeping node.js dev stack up to date on Amazons EC2

Two months ago I created a simple tutorial for installing node.js on Amazons EC2. I’m using EC2 with node.js to work on some prototypes and proof of concepts.

From the last installation I have:

  • node.js v0.10.8
  • npm 1.2.5

First, you have to update your EC2 instance (I’m using Amazon Linux AMI):

[ec2-user@... ~]$ sudo yum update
[ec2-user@... ~]$ sudo yum clean all

Clean up mess (this is optional):

[ec2-user@... ~]$ sudo npm cache clean -f
npm WARN using --force I sure hope you know what you are doing.

Install n from npm:

[ec2-user@... ~]$ sudo npm install -g n

N is a node module that can update your current node version. You can also use nvm. I have no particular reason to use n over nvm.

Install latest stable version of node (you can also choose specific version like v0.10.11):

[ec2-user@... ~]$ sudo n stable

     install : 0.10.15
       mkdir : /usr/local/n/versions/0.10.15
       fetch :
   installed : v0.10.15

Check your version of node:

[ec2-user@... ~]$ node -v

Last step is to update node and global packages (like express, forever,…):

[ec2-user@... ~]$ npm update -g
npm http GET
npm http GET
npm http GET

Check npm version:

[ec2-user@... ~]$ npm -v

And that’s it. If you have any questions or problems, feel free to ask. I will try to answer any question and help with any problems.

Leave a Reply

Your email address will not be published. Required fields are marked *