Installation of NVM
1. Download the installation package, https://github.com/coreybutler/nvm-windows/releases
2. After the download is complete, click nvm-setup, follow the steps to install, note that the path cannot contain spaces and Chinese paths, here my installation location is D:\dev\nvm
3. After the installation is complete, configure the environment variables. After the latest version of the software is installed, the variable name and variable value will be automatically generated in the user variable of the environment variable
4. nvm common commands
nvm- v // Check the version number of nvm nvm install latest // install the latest version of nodejs nvm ls // Check which versions of nodejs in the system nvm use 10.0.0 // Use 10.0.0 version of nodejs
-
Open a cmd window and enter the command:
nvm v
, then we will see the current nvm version information. Then we can install nodejs. -
Continue to enter the command:
nvm install latest
if the network is smooth, we will see a download prompt, and after the download is complete, you will be asked to use the latest node version. -
If you download it for the first time, before use,
C:\dev
there is no nodejs folder in the directory. After inputting for example:nvm use 5.11.0
You will find thatC:\dev
there is a nodejs folder in the directory. This folder is not a simple folder. It's a shortcut toC:\dev\nvm
the v5.11.0 folder inside. -
Similarly, we can download other versions of nodejs, so that through the command: for
nvm use 版本号
example:nvm use 5.11.0
version switching can be easily achieved. -
Remarks: If your computer system is 32-bit, then when downloading the nodejs version, be sure to specify 32, such as:
nvm install 5.11.0 32
This can only be used in a 32-bit computer system, and the default is 64-bit.
npm install