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

前端 未结 14 1638
遇见更好的自我
遇见更好的自我 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:11

    Everything you need is in the npm-folders documentation. I don't want to start my Win notebook now so I cannot verify it, but you should only change prefix to C:\Program Files\nodejs in your config file. If you want to change it globally for all users, edit the C:\Program Files\nodejs\npmrc file, otherwise create/edit C:\Users\{username}\.npmrc.

    But this change will probably have some side effects, so read this discussion first. I don't think it's a good idea.

提交回复
热议问题