Install npm, cnpm

 

The installation steps are as follows:

1. Go to the official website of node.js to download and install the tool, here is the default installation path, C: \ program Files \ nodejs

 

2. Enter the command prompt interface as an administrator

 After the installation is complete, enter the node -v, npm -v command on the command line to test whether the installation is successful. The version number will appear after the installation is successful. As shown below:

 

3. Change the original environment variables (configuration npm global module storage path and cache path)

 

(1) First create two folders " global " and " cache " in the C: \ Program Files \ nodejs directory

 

( 2 ) Enter the following command to change the npm configuration

 

npm config set prefix "C:\Program Files\nodejs\global"

 

npm config set cache "C:\Program Files\nodejs\cache"

 

 

4. Configure environment variables

(1) Right-click on the properties of my computer to enter this page --- click on the advanced system settings --- click on the environment variables to enter this page

 

(2) Modify the user variable PATH: add "C: \ Program Files \ nodejs \ global" to the back, separated by a semicolon.

 

(3) New system variable NODE_PATH: set to "C: \ Program Files \ nodejs \ node_global \ node_modules".


tip: Since the original environment variables have been changed in the past , when installing cnmp, it will be installed under the C: \ Program Files \ nodejs \ global \ node_modules directory, so the environment variables of cnpm may have to be changed (the following steps are very important )

 

(4) Modify the system variable path : add "C: \ Program Files \ nodejs \ global \ node_modules \ cnpm" to the back

 

5. Install cnmp

 

Installation command: npm install -g cnpm --registry = https: //registry.npm.taobao.org

 

npm install -g cnpm --registry=https://registry.npm.taobao.org

 

 

6. cmd detects whether the installation is successful (cnmp -v), even if it is successful as follows

 

 

 

 

 

ttt: The directory file after successful installation is as follows:

 

(1)

 

(2)

(3)

(4)

 

Published 8 original articles · Likes2 · Visits 489

 

Guess you like

Origin blog.csdn.net/qq_42003546/article/details/102742416