Windows post for node. JS Installation and Environment configuration

Source: Internet
Author: User
Tags install node

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) second, install 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

Download

Iv. Start installation start installing the node. JS check box and click on the "Next" button

installation directory: D:\node_js

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:\node_s" such as:

after creating two empty folders, open the cmd Command window and enter
"D:\node_js\node_global"npm config set cache "D:\node_js\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, create a new "Node_path" under "System Variables", enter "D:\node_js\node_global\node_modules",

Modify "Path" under "User variable" to "D:\node_js\node_global\"

Change "Path" under "System Variables" to "D:\node_js\"

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.