Change default global installation directory for node.js modules in Windows?

前端 未结 14 1647
遇见更好的自我
遇见更好的自我 2020-11-28 01:02

In my windows installation PATH includes C:\\Program Files\\nodejs, where executable node.exe is. I\'m able to launch node

14条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-28 01:21

    You should use this command to set the global installation flocation of npm packages

    (git bash) npm config --global set prefix /npm

    (cmd/git-cmd) npm config --global set prefix \npm

    You may also consider the npm-cache location right next to it. (as would be in a normal nodejs installation on windows)

    (git bash) npm config --global set cache /npm-cache

    (cmd/git-cmd) npm config --global set cache \npm-cache

提交回复
热议问题