Settings for global node_modules and Npm-cache folders after installing NPM under Windows 10

Source: Internet
Author: User

NPM refers to Node Package Manager, a popular bundle management and distribution tool in node. js. node. JS has joined NPM at the beginning of a version of the Windows installation package and can now go to https://nodejs.org/en/to download the installation package.

The installation process is simple, all the way Next and Finish. After the installation is complete, you can create a new command-line window and tap NPM to verify the installation.

The problem I encountered was that when I installed a global webpack tool, I found that many of the newly downloaded files were stored in both the Node_modules and Npm-cache folders under%appdata%, and I was uncomfortable because%appdata% was Roaming, These things don't really need roam.

NPM documentation Https://docs.npmjs.com/files/folders said a bunch, and it didn't work, and finally I found a way to fit me, inspired by this answer to the explosion stack:

NPM config set prefix ${userprofile}\.npm--globalnpm config set cache ${userprofile}\.npm\cache--global

In this way, there will be a NPMRC file generated in the%appdata%\npm\etc folder, the content is the above configuration, this configuration file roam is no problem.

Settings for global node_modules and Npm-cache folders after installing NPM under Windows 10

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.