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