installation steps
-
Download address : https://nodejs.org/en/, select the version to download
-
Double-click the downloaded executable file to install
-
Click "next"
-
Check "Accept Agreement" and click "nexrt"
-
Select the installation directory, click "next"
-
Add to PATH will be added to the path environment variable by default, and click "next"
-
Always keep the default, click "next", and finally click install to install
-
After the installation is complete, the directory structure is shown below:
-
Open cmd terminal
-
Check whether it is added to the environment variable
-
View node version
-
In the installation directory create two folders, respectively node_cache and node_global
If you do not set the global directory node_global, then the global default installation files will be saved to
C: \ Users \ Administrator \ AppData \ Roaming \ npm
user variable settings: speak with The value in the variable C:\Users\Administrator\AppData\Roaming\npm is changed to D:\node\node_global
System variable settings: add variable NODE_PATH=D:\node\node_modules
-
Open cmd and execute
npm config set prefix “D:\node\node_global”
npm config set cache “D:\node\node_cache”
npm list -global to view the changed value -
Configure Taobao mirror (others are also available) to increase download speed
npm config set registry=http://registry.npm.taobao.org
npm config list Display all configuration information, you can see the items just configured
View the configured mirror
-
Test using npm to install vue.js