The source code to share :http://github.crmeb.net/u/defu

One 、 Installation environment
1、 Native system :Windows 10 Pro(64 position )
2、Node.js:v6.9.2LTS(64 position )

Two 、 install Node.js step
1、 Download the corresponding to your system Node.js edition :https://nodejs.org/en/download/
2、 Select the installation directory to install
3、 Environment configuration
4、 test

3、 ... and 、 Preparation
1、Node.js brief introduction
To put it simply Node.js It's running on the server side JavaScript.Node.js It's based on Chrome V8 Engine JavaScript Running environment .Node.js An event driver is used 、 Non-blocking type I/O Model of , Make it lightweight and efficient .Node.js Package manager npm, Is the world's largest open source repository ecosystem .
2、 download Node.js
Open the download link on the official website :https://nodejs.org/en/download/ Here's what I downloaded node-v6.9.2-x64.msi, Here's the picture :
 Insert picture description here

Four 、 Start installation
1、 When the download is complete , double-click “node-v6.9.2-x64.msi”, Start installation Node.js
 Insert picture description here

Click on 【Next】 Button
 Insert picture description here

Check the box , Click on 【Next】 Button
 Insert picture description here

After modifying the catalog , Click on 【Next】 Button

 Insert picture description here
 Insert picture description here

Click after installation 【Finish】 Button to complete the installation
 Insert picture description here

thus Node.js Installation completed , You can start with a simple test to see if the installation is successful , The environment will be configured later
Press on the keyboard 【win+R】 key , Input cmd, And then go back , open cmd window
 Insert picture description here
 Insert picture description here

The directory after installation is shown in the figure below :
 Insert picture description here

This is explained below : New version of the Node.js I have brought with me npm, install Node.js Will be installed together ,npm The function of is to Node.js Dependent packages for management , It can also be understood as being used to install / uninstall Node.js What needs to be packed

5、 ... and 、 Environment configuration
explain : The main configuration of the environment here is npm The path where the global module is installed , And caching cache The path of , The reason to configure , It's because it's similar in the future :npm install express [-g] ( Later optional parameters -g,g representative global Global installation means ) When installing the statement of , Will install the installed module to 【C:\Users\ user name \AppData\Roaming\npm】 In the path , Occupy C Disk space .
for example : I want to put the full module path and cache path in me node.js Installation folder , In my installation folder 【D:\Develop\nodejs】 Next create two folders 【node_global】 And 【node_cache】 Here's the picture :
 Insert picture description here

After creating two empty folders , open cmd Command window , Input

npm config set prefix “D:\Develop\nodejs\node_global”
npm config set cache “D:\Develop\nodejs\node_cache”
 Insert picture description here

Next, set the environment variable , close cmd window ,“ My computer ”- Right click -“ attribute ”-“ Advanced system setup ”-“ senior ”-“ environment variable ”
 Insert picture description here

Enter the environment variables dialog , stay 【 System variables 】 Under the new 【NODE_PATH】, Input 【D:\Develop\nodejs\node_global\node_modules】, take 【 User variables 】 Under the 【Path】 It is amended as follows 【D:\Develop\nodejs\node_global】
 Insert picture description here
 Insert picture description here
 Insert picture description here
 Insert picture description here

6、 ... and 、 test
After the configuration , Install module Under test , We will install the most commonly used express modular , open cmd window ,
Enter the following command to install the module globally :

npm install express -g # -g Global installation
 Insert picture description here
Detailed tutorial :http://github.crmeb.net/u/defu