Home » Node Js » Ubuntu 14.04 Upgrade NodeJs to latest version

Ubuntu 14.04 Upgrade NodeJs to latest version

Use n module from npm in order to upgrade node

Original From—http://askubuntu.com/questions/426750/how-can-i-update-my-nodejs-to-the-latest-version

# clear npm cache
sudo npm cache clean -f 
# install node n package
sudo npm install -g n
# install most stable node package
sudo n stable
# (or install most latest node package)
sudo n latest
# link node executable to /usr/bin
sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/node
# check node version
node -v
# check npm version
npm -v

To uninstall

#install ubuntu original node package
sudo apt-get install --reinstall nodejs-legacy 
# remove installed node package
sudo n rm 7.8.0
# remove n package
uninstall -g n

Leave a Reply

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