Nodejs NPM cnpm Elegant installation Install

Source: Internet
Author: User
Tags rar

Since NPM and CNPM are able to install components, some of the installed components are stored in the C-drive user directory of the AppData hidden directory, and some are saved in the directory of the installation node, and installed in the C drive, the reinstall system has to be re-deployed, it is troublesome, so here to provide elegant installation of the way, no longer afraid of reloading system , no longer afraid of components can not be found on the package.

Download Node-v4.2.4.rar decompression to the corresponding directory, I was reduced to "D:\Program Files" under this directory
Download path: [Node-v4.2.4.rar] (http://download.csdn.net/detail/as763190097/9410428)

Configuration of environment variables:
1. Add ————-in the path variable to replace your own corresponding directory
";D: \program Files\node\nodejs;d:\program Files\node\node-global"

2. Add a system variable Node_path
Value is
";D: \program Files\node\node-global\node_modules;d:\program Files\node\nodejs\node_modules"

3. Add a user variable to the path
";D: \program Files\node\nodejs\node_modules\npm"
If you have previously installed node, modify this path

After this step, you can test the node environment, enter NODE-V input NPM-V test environment variables are paired

4. Configure the Global module storage path and cache path for NPM
Enter the following command
NPM config set prefix "D:\Program files\node\node-global"
NPM config set cache "D:\Program Files\node\node-cache"
5. Installing CNPM

Enter the command under CMD:
NPM Install Cnpm-g

6. Set the global module storage path and cache path for the CNPM
CNPM config set prefix "D:\Program files\node\node-global"
CNPM config set cache "D:\Program Files\node\node-cache"

The modules that NPM and CNPM install later are all in the D:\Program files\node\node-global\node_modules directory.

Nodejs NPM cnpm Elegant installation Install

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.