node. JS installation and Environment configuration Windows chapter I, installation environment
1. Native system: Windows ten Pro (64-bit)
2, Node.js:v6.9.2lts (64-bit)
Ii. Installing the node. JS Step
1. Download the node. JS version that corresponds to your system: https://nodejs.org/en/download/
2, choose the installation directory for installation
3. Environment configuration
4. Testing
III. Preparation of the preparatory
1. node. JS Profile
Simply put, node. JS is the JavaScript that runs on the server. node. JS is a JAVASCRIPT runtime environment based on the Chrome V8 engine. node. JS uses an event-driven, non-blocking I/O model to make it lightweight and efficient. node. JS's Package Manager, NPM, is the world's largest open source library ecosystem.
2. Download node. js
Open the official website download link: https://nodejs.org/en/download/I download here is Node-v6.9.2-x64.msi, such as:
Iv. start of installation
1. When the download is complete, double-click "Node-v6.9.2-x64.msi" to begin installing node. js
Click on the "Next" button
Tick the checkbox and click on the "Next" button
After modifying the catalog, click on the "Next" button.
After installation, click "Finish" button to complete the installation
Now that node. JS has been installed, it is possible to perform a simple test installation successfully, followed by an environment configuration
Press the "Win+r" key on the keyboard, enter CMD, and then enter to open the CMD window
The directory after installation is as follows:
Here's how: The new node. JS has its own NPM installed with node. JS, and NPM manages the packages that node. js relies on, or it can be understood to install/Uninstall what node. js needs to be loaded.
Five, environment configuration
Description: The environment configuration here is primarily configured with the path of the global module where NPM is installed, and the path of the cache caches, which is to be configured as follows: NPM install express [-G] (the following optional parameter-G, G for the installation statement of global installation, the installed module is installed in the "C:\Users\ User name \appdata\roaming\npm" path, which occupies the space of C disk.
For example: I want to place the path and cache path for the full module in my node. JS installation folder, then create two folders "Node_global" and "Node_cache" Under My Installed folder "D:\Develop\nodejs" such as:
After creating two empty folders, open the cmd command window and enter
npm config set prefix"D:\Develop\nodejs\node_global"npm config set cache "D:\Develop\nodejs\node_cache"
Next set environment variables, close cmd window, "My Computer"-Right-click "Properties"-"Advanced system Settings"-"Advanced"-"Environment variables"
Enter the Environment Variables dialog box, under System variables, create a new Node_path, enter "D:\Develop\nodejs\node_global\node_modules", and modify "PATH" under User variables to "D:\Develop\ Nodejs\node_global "
VI. Testing
After the configuration, install the module test, we will install the most common Express module, open a CMD window,
Enter the following command to install the module globally:
install express -g # -g是全局安装的意思
Windows post for node. JS Installation and Environment configuration