Skip to content

Instantly share code, notes, and snippets.

@adeelibr
Last active June 22, 2020 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adeelibr/eee72ba0c958724f7997e8e2a949c640 to your computer and use it in GitHub Desktop.
Save adeelibr/eee72ba0c958724f7997e8e2a949c640 to your computer and use it in GitHub Desktop.
How to install Node via NPM

Installation guide for Mac OS & Linux

Open your terminal & type

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

Close your terminal & reopen a new one & type

nvm ls

You will see something like

system
iojs -> N/A (default)
node -> stable (-> N/A) (default)
unstable -> N/A (default)
nvm_list_aliases:36: no matches found: /Users/adeelimran/.nvm/alias/lts/*

Next in your terminal type

nvm install 12.16.1

Once it is installed, we can start using it

nvm use 12.16.1

Now that it is installed let's check it by doing

node --version // will output v12.16.1

Uninstall NVM

rm -rf $NVM_DIR ~/.npm ~/.bower

Installation guide for Windows

Nvm can be used to manager various node version:

  • Step1: Download nvm https://github.com/coreybutler/nvm-windows/releases
  • Step2: Choose nvm-setup.zip
  • Step3: Unzip & click on installer.
  • Step4: Check if nvm properly installed, In new command prompt type nvm
  • Step5: Install node js using nvm : nvm install : The version can be a node.js version or "latest" for the - latest stable version
  • Step6: check node version - npm -v
  • Step7: If you want to install another version of node js - Use STEP 5 with different version.
  • Step8: Check list node js version - nvm list
  • Step9: If you want to use specific node version do - nvm use
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment