Windows post for node. JS Installation and Environment configuration

Source: Internet
Author: User
Tags install node

First, installation environment

1. Native System: Windows 7 Flagship edition (64-bit)
2, node.js:node-v8.2.1-x64

Ii. Installing the node. JS Step

1, download the corresponding system node. JS Version: https://nodejs.org/en/download/
2, choose the installation directory for installation (not recommended to install directly on the C drive)
3, environment configuration, change npm default path
4. Testing

Third, install node. js.

1, open the official website download link: https://nodejs.org/en/download/, download the corresponding version.

2, install node. js. Double-click on the downloaded installation package, all the way to next, and note that when installing the path step, modify it to the desired path.

3, after the installation is complete, open cmd, enter node-v and npm-v if the correct version number appears, the installation is successful.

After the installation is complete, such as:

Iv. Change the NPM default path

Description: Changing the NPM default path is the path to the global module where NPM is installed, and the path to cache caches. The reason for this change is that the installed module will be installed to the C:\Users\ user name \appdata\ when executing the installation command similar to the following: NPM install Express [-G] (the optional parameter-g,g on behalf of the global installation). ROAMING\NPM "path.

Example: If you place the full module path and cache path in my node. JS installation folder, create two Folders "Node_global" and "Node_cache" under the folder I installed "D:\study\node.js" such as:

After creating two empty folders, open the cmd command window and enter:

npm config set prefix "D:\study\nodejs\node_global"

npm config set cache "D:\study\nodejs\node_cache"

(Configure environment variables, it is said that now do not need to configure environment variables, I have not tried.) Next time you have a chance, try not to configure the environment variable to see if the installation succeeds. )

Briefly write on how to configure the environment variables.

1. Close the cmd window, "My Computer"-Right-click "Properties"-"Advanced system Settings"-"Advanced"-"Environment variables".

2. Enter the Environment Variables dialog box, modify "Path" under "User variable" to "D:\study\nodejs\node_global", and under "System variable", create "Node_path", enter "D:\study\node.js\node_ Global\node_modules ".

3, save the changes.

v. 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是全局安装的意思

For example, the installation was successful.

You can also enter Command Express--version in CMD. Such as:

Windows post for node. JS Installation and Environment configuration

Related Article

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.