How to set npm root path to …/Appdata/roaming/npm

我怕爱的太早我们不能终老 提交于 2019-12-13 03:57:14

问题


I have installed nodejs ->8.12.0 and npm ->6.4.1 and trying to install angular 1.7.4
I have added environment variable path to

C:\Users\user_name\AppData\Roaming\npm

and

C:\Users\user_name\AppData\Roaming\npm\node_modules\@angular\cli\bin

but when i run npm root -g it shows current directory path, not the path i set Nodejs is install to

C:\Program Files\nodejs


回答1:


I found a way to set the global path to roaming. Go to:

C:\Users\YOURNAME\.npmrc

and locate NPMRC. Edit the file to:

C:\Users\username\AppData\Roaming\npm

If .npmrc is not visible you will end to show your hidden files



来源:https://stackoverflow.com/questions/53081090/how-to-set-npm-root-path-to-appdata-roaming-npm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!