I. Installation Sequence
1: NVM must be installed first. NVM stands for Node Version Manager, which is used to manage Node versions.
2: Use NVM to download node. Because node integrates the NPM package manager.
3: Download CNPM through NPM to switch to the domestic source, improve the download speed. npm install -g cnpm
4: NRM (NPM Registry Manager) is the mirror source management tool of NPM. Sometimes foreign resources are too slow, so we can use this to switch the mirror source. First install the NRM globally
npm install -g nrm
Once installed and ready to use immediately, let’s list the available sources:
nrm ls
You’ll find the following sources listed:
npm —- registry.npmjs.org/
cnpm — r.cnpmjs.org/
taobao – registry.npm.taobao.org/
nj —– registry.nodejitsu.com/
rednpm – registry.mirror.cqupt.edu.cn/
npmMirror skimdb.npmjs.com/registry/
edunpm – registry.enpmjs.org/
The second installation NVM
1: download
You can download link here: pan.baidu.com/s/1wW4fH8Xn… Password: pn90
Or download the latest version at github github.com/coreybutler…
Nvm-noinstall. zip: This is the green installation-free version, but needs to be configured before use
Nvm-setup. zip: this is the installation package, after downloading, click install, no configuration to use, convenient.
Source code(zip) : zip compressed Source code
Sourc code(tar.gz) : tar.gz source code, generally used for * NIx systems
Most importantly: Uninstall Node before installing NVM or you’ll have all sorts of problems
2: How to delete Node.js if it is already installed
How to delete Node.js from Windows
1. Uninstall programs and functions from the uninstaller.
2. Restart (or you might kill all node-related processes from task manager).
3. Look for these folders and delete them (and their contents) (if there are any). Depending on the version you install, UAC Settings, and CPU architecture, these may or may not exist:
C:\Program Files (x86)\Nodejs
C:\Program Files\Nodejs
C:\Users{User}\AppData\ folder \ NPM (or % AppData %\ NPM)
C:\Users{User}\AppData\Roaming\npm-cache (or % AppData % npm-cache)
4. Check your %PATH% environment variable to ensure that no references to Nodejs or NPM exist.
5. If you still haven’t unmounted, type where node at the command prompt and you will see where it is – deleted (or possibly the parent directory).
6. Reboot, good move
3: installation
Unzip to an all-English path
I use the installation version, nVM-setup.zip
- You need to create a new folder dev on drive C, and create sub-folders, one NVM and one nodejs under the dev folder
- Continue to Next until the installation is complete
3. Under C:\dev\ NVM, double-click install. CMD to generate a Settings file, or paste the contents of my file. Settings.txt reads as follows:
root: C:\dev\nvm
path: C:\dev\nodejs
arch: 64
proxy: none
node_mirror: https://npm.taobao.org/mirrors/node/
npm_mirror: https://npm.taobao.org/mirrors/npm/
Copy the code
For example, root: C:\dev\ NVM, root: must be followed by a space
Path: specifies the directory where the node shortcut resides. For example, path: C:\dev\nodejs, path: must be followed by a space
Arch: bits configured for the current operating system (32/64)
Note: Root: and path: must be followed by a space; otherwise, the node will not be installed in the NVM folder during node installation
This step is mainly to NPM mirror mirror to taobao, can improve the download speed node_mirror: https://npm.taobao.org/mirrors/node/ npm_mirror: https://npm.taobao.org/mirrors/npm/Copy the code
4. Edit the settings. TXT file in the decompression directory (if it does not exist, create a new TXT file. Do not change the encoding of the file.
5. Configure environment variables
You can use window+r: sysdm.cplCopy the code
Configure the path
Configure user variables:
NVM_HOME----- NVM folder address,SYSLINK_HOME----nodejs folder addressCopy the code
NVM_HOME: root in <==> settings. TXT where nvm.exe is located
NVM_SYMLINK: path in <==> settings. TXT where the node shortcut resides
PATH: + = % NVM_HOME %; %NVM_SYMLINK%;
Open CMD and run the set NVM_HOME and set NVM_SYMLINK commands to check whether environment variables are successfully configured
In PowerShell, the command is dir env:[name]
Note: the order of the NVM_HOME and NVM_SYMLINK environment variables must not be changed. Create * firstNVM_HOME create NVM_SYMLINK*
**PATH must be +=, after the environment variable '; 'There must be no less sexCopy the code
Configure system variables:
NVM_HOME----- NVM folder address,SYSLINK_HOME----nodejs folder addressCopy the code
NVM_HOME: root in <==> settings. TXT where nvm.exe is located
NVM_SYMLINK: path in <==> settings. TXT where the node shortcut resides
PATH: + = % NVM_HOME %; %NVM_SYMLINK%;
Yes, the system variables and the user variables are matched the same, I matched them all. Ha, ha, ha
5. Check whether the vm is created successfully
CMD => enter NVM and press Enter to see if some NVM commands are displayed. If the command output is displayed, the NVM is successfully created
Type NVM install 10.10.0 and press Enter. The command will install and download node10.10.0
NVM install latest Downloads the latest Node version.
The following are common commands
NVM arch [32 | 64] : display the node is run on a 32-bit or 64 – bit mode. Specify 32 or 64 to override the default architecture.
– NVM install [arch] : This can be the Node. js version or latest stable version. (Optional [ARCH]) Specifies whether to install the 32-bit or 64-bit version (the default is System ARCH). Set [Arch] to all to install the 32 – and 64-bit versions. Adding -insecure at the end of the command bypasses SSL authentication on the remote download server.
NVM list [available] : lists installed Versions of Node.js. Optional available, displays a partial list of downloadable versions. This command can be abbreviated to NVM ls [available].
NVM on: Enables node.js version management.
NVM off: Disables Node.js version management (without uninstalling anything)
NVM proxy [URL] : Sets the proxy used for download. Leave [URL] blank to view the current agent. Set [url] to None to remove the proxy.
NVM node_mirror [url] : sets the node mirror. The default value is nodejs.org/dist/. You can set…
NVM npm_mirror [url] : NPM mirror. The default value is github.com/npm/npm/arc…
NVM uninstall: Uninstalls the specified nodeJS version.
NVM use [version] [arch] : Switches to using the specified NodeJS version. 32/64 bit [ARCH] can be specified.
– NVM use: continues to use the selected version, but switches to 32/64-bit mode based on the provided value
NVM root [path] : Sets the directory where NVM stores different versions of Node.js. If this directory is not set, the current directory is used.
– NVM version: displays the current RUNNING NVM version, which can be abbreviated as NVM V
First, use the NVM List to see which versions are currently installed
NVM List available Displays a partial list of downloadable versions
NVM install Version number Installs the specified nodeJS version
NVM use Version number Uses the nodeJS of the specified version