Skip to main content

nvm-windows

Manage multiple installations of node.js on a Windows computer.

danger

I found out that nvs is better for using with multiple node versions. See my post.

Source: github.com: Node Version Manager (nvm) for Windows

nvm-windows Installation

caution

It is always recommended to remove any existing installations of Node.js or npm from your operating system before installing a version manager as the different types of installation can lead to strange and confusing conflicts. This includes deleting any existing nodejs installation directories (e.g., C:\Program Files\nodejs) that might remain. nvm's generated symlink will not overwrite an existing (even empty) installation directory. For help with removing previous installations, see stackoverflow.com: How to completely remove node.js from Windows.

  1. Download from github.com: nvm (Windows) releases one of the latest installers (for example, nvm-setup.zip), unzip it and run nvm-setup.exe file with default settings.

  2. Open PowerShell and check the npm version:

    npm --version
    6.14.11
  3. Install the current release of node.js (for testing the newest feature improvements, but more likely to have issues than the LTS version):

    nvm install latest
  4. And install the latest stable LTS release of node.js (recommended) by first looking up what the current LTS version number is with:

    nvm list available
    tip

    Also you can see all available node versions at nodejs.org

    then installing the LTS version number with:

    nvm install <version>

    replacing <version> with the number, ie: nvm install 12.14.0.

  5. List what versions of node are installed:

    nvm ls

    now you should see the two versions that you just installed listed.

    note

    At the moment (2020-03-20), I have installed node.js version 10.x due to compatibility issues and version 12.x due to Docusaurus requirement.

  6. After installing the node.js version numbers you need, select the version that you would like to use by entering:

    nvm use <version>

    replacing <version> with the number, ie: nvm use 12.9.0.

  7. To change the version of node.js you would like to use for a project, create a new project directory:

    mkdir NodeTest   # Create the directory

    cd NodeTest # and enter the directory

    nvm use <version> # then enter node version

    replacing <version> with the version number you'd like to use (ie: v10.16.3).

  8. Verify which version of npm is installed with:

    npm --version

    this version number will automatically change to whichever npm version is associated with your current version of node.js.

Upgrading nvm-windows

To upgrade nvm-windows, 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.

.nvmrc error Windows

If:

PowerShell
❯ nvm use
.0.0
node v.0.0 (64-bit) is not installed.

First, run:

nvm on

Then:

PowerShell
type .\.nvmrc | %{$_ -replace "v",""} | %{nvm install $_}
type .\.nvmrc | %{$_ -replace "v",""} | %{nvm use $_}

Other nvm commands:

nvm current

source: github.com: nvm use with nvmrc as node node v.0.0 (64-bit) is not installed.