Can someone tell me where can I find the Node.js modules, which I installed using npm
?
Javascript – Where does npm install packages
javascriptlocationnode.jsnpm
Related Topic
- Javascript – the !! (not not) operator in JavaScript
- Javascript – How to pass command line arguments to a Node.js program
- Node.js – How to update NodeJS and NPM to the next versions
- Node.js – Find the version of an installed npm package
- Node.js – How to uninstall npm modules in Node.js
- Javascript – How to return the response from an asynchronous call
- Node.js – What’s the difference between dependencies, devDependencies and peerDependencies in npm package.json file
- Node.js – the –save option for npm install
Best Answer
Global libraries
You can run
npm list -g
to see which global libraries are installed and where they're located. Usenpm 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 theNODE_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
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.When installing use -g option to install globally
npm install -g pm2
- pm2 will be installed globally. It will then typically be found in/usr/local/lib/node_modules
(Usenpm 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