Npm Global Packages Storage

[Solved] Npm Global Packages Storage | Shell - Code Explorer | yomemimo.com
Question : npm global packages storage

Answered by : luk164

You can run npm list -g to see which global libraries are installed and where they're located. Use npm list -g | head -1 for truncated output showing just the path. If you want to display only main packages not its sub-packages which installs along with it - you can use - npm list --depth=0 which will show all packages and for getting only globally installed packages, just add -g i.e. npm list -g --depth=0.
On Unix systems they are normally placed in /usr/local/lib/node or /usr/local/lib/node_modules when installed globally. If you set the NODE_PATH environment variable to this path, the modules can be found by node.
Windows XP - %USERPROFILE%\AppData\npm\node_modules
Windows 7, 8 and 10 - %USERPROFILE%\AppData\Roaming\npm\node_modules

Source : https://stackoverflow.com/questions/5926672/where-does-npm-install-packages | Last Update : Fri, 09 Apr 21

Answers related to npm global packages storage

Code Explorer Popular Question For Shell