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

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

提交回复
热议问题