nvm install and configure detailed tutorial

The latest installation tutorial here http://www.cnblogs.com/yesyes/p/7403184.html, simpler

The following tutorial is outdated

nvm is nodejs version management tool, why should nvm, you can Baidu compared to this article is the cause had met with, and we know nodejs official update very quickly, sometimes with business needs require a certain version If using a msi installation, although the installation of very simple, but behind the trouble, here is my shift the day conclude tutorial, just follow this to the configuration, no problem, we should not take the trouble to learn later You can save over time.

win32 system I use, install nvm, then nodejs, last npm
nvm detailed installation steps:
One: Run as administrator install.cmd file, set the file path
root: C:\nvm
path: C:\nodejs
arch: 32 
proxy: none
Ensure that there is a setting.txt file directory (the picture is a screenshot after I configured default without those folders)
Enter cmd command line input nvm nvm see the version number indicates a successful installation nvm
 Download the required nodejs version, renamed after decompression (such as v6.9.1) into nvm directory, pay attention to the inside if there are nested folders put the file to get the outer layer
 
Two: the environment variable configuration: Click My Computer "Properties" Advanced Settings "Environment Variables"
1. Remove the system comes with nvm variables: NVM_HOME and NVM_SYMLINK
2. Open the path: C variables automatically delete nvm added: \ nvm; C: \ Program Files \ nodejs
3. Configure user variables:
NVM_HOME = C: \ NVM      
NVM_SYMLINK = C: \ nodejs  
Path = %NVM_HOME%;%NVM_SYMLINK%
Save configuration
4.cmd command line: nvm use 6.9.1 (installed version required), 32-bit systems (nvm use 6.9.1 32), see Now useing node v6.9.1 represents a successful installation
At the same time there will be in the same directory nvm a quick nodejs folder that you want to switch to the release version, for example (nvm use 7.2.0)
 
Three: npm install and configure the environment variables
1. Copy v6.9.1 following npm package, I put it in a folder inside nvm
2. environment variable configuration:
NPM_HOME = C: \ NVM \ npm  
Path =% NPM_HOME%
3. In the user directory (for example, my: C: \ Users \ admin) to create a new file .npmrc
It reads as follows:
cache = C: \ nvm \ nper cover 
prefix = C: \ NVM \ Elevation
4. Restart command window: npm config list to view the configuration log, the display is a directory of your configuration indicates successful installation
 
Here nvm nodejs npm have been successfully installed, then open a command window to install a package test, npm install -g gulp, after the installation is complete will see new downloadable package under npm "node_modules directory, and nodejs is due npm isolated, whether you switch to any version, do not need to re-install these packages, although the official npm package integrated into nodejs, but in order to facilitate the switch must be three separate, if you encounter any problems, give me a message, see will return to the set

Guess you like

Origin www.cnblogs.com/wangluochong/p/11664778.html