修改Nodejs默认配置路径

1 查看位置

npm config ls

2 修改路径

npm config set prefix "D:\Software\nodejs\node_modules\npm\node_global_modules"

npm config set cache "D:\Software\nodejs\node_modules\npm\node_cache"

3 修改环境变量

新增环境变量 NODE_HOME

修改环境变量中Path,追加     %NODE_HOME%\;%NODE_HOME%\node_modules;%NODE_HOME%\node_modules\npm\node_global_modules\;

4 测试一下

 

 

 

来源:https://blog.csdn.net/gao_xu_520/article/details/85764829   ;

https://www.cnblogs.com/liaojie970/p/9296177.html

posted @ 2022-03-10 11:29  yaoe  阅读(464)  评论(0)    收藏  举报