Gnvm Switch Node Version

Question

When npm runs the project, an error is reported:

Found binding for the following environments:
-Windows 64-bit with Node.js 11.x

It is found that the npm package of this project requires 11.x version node, so in order not to affect other projects, you can take the method of managing multiple node versions, similar to multiple versions of python

Step

  1. Download gnvm

    Method 1: Official website [http://ksria.com/gnvm/](http://ksria.com/gnvm/)
    
    Method 2: Baidu Cloud [https://pan.baidu.com/s/1z0q9z01dWV24Ohenaihu_A](https://pan.baidu.com/s/1z0q9z01dWV24Ohenaihu_A)

    Extraction code: nsnj

  2. Put gnvm.exe in the node.js installation directory, which is the same level directory as node.exe, such as mine: C:\Program Files\nodejs directory

  3. CMD check whether the installation is successful

gnvm version
  1. Install the desired node version
gnvm install 11.15.0
  1. View the currently available node version
gnvm ls
  1. Switch node version
gnvm use 11.15.0
  1. View the current node version
node -v

Precautions

gnvm install 11.15.0 may be unsuccessful, the official https://nodejs.org/dist/ is a lot of node.exe that cannot be found, you can create an empty folder in the C:\Program Files\nodejs directory by yourself 11.15.0, manually download the corresponding version of node.exe and put it in the 11.15.0 folder, check it with gnvm ls, and then switch with gnvm use

Reference

Comments