Skip to content

Latest commit

 

History

History
103 lines (63 loc) · 3.36 KB

README.md

File metadata and controls

103 lines (63 loc) · 3.36 KB

Installation guide for NVM in windows

nvm (Node Version Manager) is a tool used to download and install multiple Node.js versions.
npm (Node Package Manager) is a tool that allows you to install javascript packages.

Prerequisite:

Uninstall existing version of node since we won’t be using it anymore
Delete any existing nodejs installation directories.( e.g. “C:\Program Files\nodejs” OR C:\Program Files (x86)\nodejs ) that might remain. NVM’s generated symlink will not overwrite an existing (even empty) installation directory.

Delete the npm install directory at C:\Users[Your User]\AppData\Roaming\npm
We are now ready to install nvm. Download the installer from Here

Delete the existence of nvm (C:\Users\xxx\AppData\Roaming\nvm), basically, manually delete the nvm dir.

To upgrade, run the new installer. It will safely overwrite the files it needs to update without touching your node.js installations. Make sure you use the same installation and symlink folder. If you originally installed to the default locations, you just need to click “next” on each window until it finishes.

Installation

  1. Download nvm for Windows

  2. Choose nvm-setup.zip

  3. Unzip & click on installer.

  4. Check if nvm properly installed, In new command prompt type nvm.

  • Environment variable : Nodejs, Nvm and Npm installation directory path

    • C:\Program Files\nodejs > Nodejs directory path
    • C:\Users[Your User]\AppData\Roaming\nvm
    • C:\Users[Your User]\AppData\Roaming\npm
  1. Install node js using nvm : nvm install : The version can be a node.js version or "latest" for the latest stable version

  2. check node version - node -v

  3. (Optional)If you want to install another version of node js - Use STEP 5 with different version.

  4. Check list node js version - nvm list

  5. If you want to use specific node version do - nvm use

NVM Basic Commands

  • View remote available versions of Node.

    $ nvm ls-remote
  • View local installed versions.

    $ nvm ls
  • Install a specific version.

    $ nvm install <version number>
  • Switch to a specific version of Node.

    $ nvm use <version number>
  • Uninstall a specific version.

    $ nvm uninstall <version number>
  • Displays the current running version of NVM for Windows.

    $ nvm version 

Errors

  • If you get error like npm/nvm/node not recognized as an internal or external command => follow step 4

  • "nvm use" doesn't Switch node version =>

    1. (Workaround) rename "C:\Program Files\nodejs" to "C:\Program Files\nodejsx"

      Problem persist if nodejs directory exists, since nvm can not change it to a symlink and fails

    2. Open command prompt with administrator privilege, and then you can switch the version.
  • While executing nvm install <version number> command, error: Could not retrieve ..... => Try nvm proxy [url of your proxy server]

Reference Links

Please feel free to contribute to the project,create a pull request