Under normal circumstances, when we configure global variables, there will be a problem npm WARN config global --global
, --local
are deprecated. Use `–location
Note: This configuration is to
create two folders [node_global] and [node_cache] in the installation directory for the global configuration 】Used to store cache information, etc.
After creating two empty folders, open the cmd command window and enter
npm config set prefix "Here is the path where you installed node.js\node_global"
npm config set cache "Here is the path where you installed node.js\node_cache"
But some will have this problem as shown in the figure:
Problem: npm WARN config global --global
, --local
are deprecated. Use --location=global
instead.
problem causes
The global configuration of npm --global, --local is deprecated. Use --location=global instead.
Need to modify:
These two files need to be modified: change prefix -g in the file to prefix --location=global
After the change, there will be no problem in re-executing.