steffen-wirth
5/10/2016 - 5:43 AM

install node js ubuntu / vagrant

install node js ubuntu / vagrant

# Note: if your host OS is Windows,
# run "vagrant up" in a command-line as administrator
vagrant up
 
# connect to guest OS through SSH
vagrant ssh
 
# update APT repositories before installing anything else
sudo apt-get update
 
# install g++ to compile stuff
sudo apt-get install -y g++
 
# retrieve nodesource stuff 0.12 to have a node.js version 0.12.7 installed
sudo curl -sL https://deb.nodesource.com/setup_0.12 | sudo sh
 
# install node.js the usual way (will also install npm this time)
sudo apt-get install -y nodejs
 
# let's get "node_modules" out of the synced folder
mkdir /home/vagrant/node_modules
cd /var/www/project
ln -s /home/vagrant/node_modules/ node_modules
 
# install a node.js package locally in the project
npm install karma