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

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

    Find the current path of your global node package installation by following command.

    npm list -g --depth=0

    Change this path to correct path by following command.

    npm set prefix C:\Users\username(Number)\AppData\Roaming\npm\node_modules

    It worked for me. Read my previous answer for better understanding.

    0 讨论(0)
  • 2020-11-28 01:35

    Using a Windows symbolic link from the C:\Users{username}\AppData\Roaming\npm and C:\Users{username}\AppData\Roaming\npm-cache paths to the destination worked great for me.

    How to add a symbolic link

    0 讨论(0)
提交回复
热议问题