Where does npm install packages?

后端 未结 23 1603
梦毁少年i
梦毁少年i 2020-11-22 06:03

Can someone tell me where can I find the Node.js modules, which I installed using npm?

23条回答
  •  迷失自我
    2020-11-22 06:26

    Windows 10: When I ran npm prefix -g, I noticed that the install location was inside of the git shell's path that I used to install. Even when that location was added to the path, the command from the globally installed package would not be recognized. Fixed by:

    1. running npm config edit
    2. changing the prefix to 'C:\Users\username\AppData\Roaming\npm'
    3. adding that path to the system path variable
    4. reinstalling the package with -g.

提交回复
热议问题