Installing Node.js/npm on Linux (Ubuntu-Mint-Deb) – Best Way

facebooktwittergoogle_plusredditpinterestlinkedinmailfacebooktwittergoogle_plusredditpinterestlinkedinmail

After a few hours of trying to install the latest version of Node.js / npm and failing to do it using the package manager because the package on the repositories is not the latest. I came across a few tutorials and below are the steps that are guaranteed to work.

Open your terminal window and run the following commands

sudo apt-get update
sudo apt-get install build-essential libssl-dev

Either
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | NVM_DIR=$HOME/.nvm bash
OR
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | NVM_DIR=$HOME/.nvm bash

export NVM_DIR=$HOME/.nvm
[ -s $NVM_DIR/nvm.sh ] && . $NVM_DIR/nvm.sh

To check if the nvm is installed and running correctly run the command below, it should output: nvm

command -v nvm

Run the following command to see the list of versions available and to see the latest version

nvm ls-remote

After checking the list in the output, find the latest version, you should see these words beside it:
(Latest LTS: Argon). At the moment of writing this it was v4.4.7

Run the commands

nvm install v4.4.7

npm install npm -g

To make sure the installation is successful, run the following commands and you should see the version

node -v

npm -v

That is it.

 

More Posts - المزيد من المقالات

  • Egypt – Convert Phonebook to New Mobile Codes Okay, this is a quick one to help poor folks convert their phone book mobile numbers to the new codes in Egypt... Export your phonebook (don't ask me how, every phone is different), make […]
  • Europe & The DAESH Within “One day not very far, Europe will wake up to a nightmare”. I made this comment to friends during a 2012 visit to Europe. They swiftly dismissed it. Yet just two years later, with DAESH […]
  • Egypt: Ace, King, Queen, Jack and Joker The scene in Egypt is nothing less than a complicated mess: there are several forces, shifting alliances, political stagnation, mass frustration, a failing economy and conspiracy theories. […]
  • The Organization: Resolving Not Just Dissolving No one can deny that what Egypt is going through now is baffling, and muddles for many people a clear analysis of the issues, especially as involvement in the ever accelerating stream of […]
facebooktwittergoogle_plusredditpinterestlinkedinmailfacebooktwittergoogle_plusredditpinterestlinkedinmail

Leave a Reply

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


× five = 20

Kemety Think Bank © 2016 Frontier Theme