Can someone tell me where can I find the Node.js modules, which I installed using npm
?
the package is installed in the current file tree, under the node_modules subfolder. As this happens, npm also adds the lodash entry in the dependencies property of the package. json file present in the current folder.
You can install a package locally if you want to depend on the package from your own module, using something like Node. js require . This is npm install 's default behavior.
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
Non-global libraries are installed the node_modules
sub folder in the folder you are currently in.
You can run npm list
to see the installed non-global libraries for your current location.
npm install -g pm2
- pm2 will be installed globally. It will then typically be found in /usr/local/lib/node_modules
(Use npm root -g
to check where.)
npm install pm2
- pm2 will be installed locally. It will then typically be found in the local directory in /node_modules
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With