Nodejs+npm+windows Configuration

Source: Internet
Author: User

Original article link: http://blog.csdn.net/xxmeng2012/article/details/51492149| very grateful to the original article Bo master to provide sharing

1, download the node installation package, the official website Zip package for decompression free installation version, the need to configure environment variables. The MSI version is the installation version, where the MSI version is used, which automatically adds the Path,path value to the installation path.

2, install Si cho Good installation path directly click Next to complete, detection is OK:

2.1 Win+r

2.2 Node-v

2.3 npm-v

2.2 and 2.3 Enter separately, and the corresponding version number in the terminal indicates that the installation is complete. Right after the direct node return to enter node development mode

3, Nodet through NPM to manage the installation package (domestic may need to use CNPM), sometimes you may need to configure a custom directory to manage the installation package, then continue to configure the following:

3.1 Create the corresponding directory in the specified directory, for example, using the original blogger's Node_global and Node_cache, built in the node home directory

3.2 Enter CMD, use

NPM config set prefix "Node_global Directory Absolute Path" (carriage return)

NPM config Set cache "Node_cache Directory absolute Path" (carriage return)

3.3 Install a module to test whether the path configured in 3.2 is in effect

NPM Install Express-g #安装express模块到全局路径 (the screen terminal will scroll to display the Express installation directory tree structure during installation)

3.4 Configuring environment variables

• System variables add node_path and corresponding values

• User variable path needs to add the node installation path to the absolute path to Node_global #否则会出现命令无法使用

3.5 Verify that the node module path is fully configured

3.5.1 into CMD terminal

3.5.2 Node (enter)

3.5.3 require (' Express ') #装载express模块, appears as configuration complete.

Nodejs+npm+windows 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.