Monday, October 11, 2010

How to properly install Node.js and npm

I'm documenting here the proper way to install node.js in case I might need to do it again. I'm using the word "proper" because the first time I installed node.js, I did it system wide and that
made it very difficult for me to install npm, the node.js package manager. So, without further ado:

Installing Node.js
git clone git://github.com/ry/node.git
cd node
./configure --prefix=$HOME/my_node
make install
Open $HOME/.profile and add:
export PATH=$PATH:$HOME/my_node/bin
Then run:
source $HOME/.profile

Installing npm
Simply do:
curl http://npmjs.org/install.sh | sh