The MEAN stack pt.3 Node.js

We are continuing to install the mean stack on a fresh cluster of Ubuntu 12.04.3 machines.
This part is a lot less complicated than setting up the databases.

install Node:

sudo apt-get update
sudo apt-get install -y python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install -y nodejs

I don’t like having to do “sudo npm install …” so I run these commands to allow local npm installs

mkdir ~/.local
echo "prefix = ~/.local" > ~/.npmrc
echo 'PATH="$HOME/.local/bin:$PATH"' >> ~/.profile

Now, when you log out, and then back in, you will be able to install npm modules without using sudo.

Leave a Reply