Windows post for node. JS Installation and Environment configuration

Source: Internet
Author: User

Download---Install to D:\Develop---installation

Check if node is installed successfully: WINDOW+R---cmd---node-v

Check npm:window+r---cmd---npm-v

The directory after installation is as follows:

To configure environment variables:

1, create two folders under D:\Develop\nodejs "Node_global" and "Node_cache"

    • Node_cache: Cache Directory
    • Node_global: Global Package Directory

2, 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

3, Next set environment variable, close cmd window, "My Computer"-Right-click "Properties"-"Advanced system Settings"-"Advanced"-"Environment variable"

User Variable--path--edit:

System Variables--NEW:

Check that the global variables are configured well:

1,

NPM install express-g     #-G is the meaning of the global installation

Enter node, and then enter "require (' Express ')" to test whether the global path of the node module is configured correctly.

Final Result:

The environment variables are well-equipped.

Reference:

Https://www.jianshu.com/p/03a76b2e7e00

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.