Can someone tell me where can I find the Node.js modules, which I installed using npm
?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- Keeping track of variable instances
As the other answers say, the best way is to do
However, if you have a large number of
npm
packages installed, the output of this command could be very long and a big pain to scroll up (sometimes it's not even possible to scroll that far back).In this case, pipe the out to the
more
program, like thisThe command
npm root
will tell you the effective installation directory of your npm packages.If your current working directory is a node package or a sub-directory of a node package,
npm root
will tell you the local installation directory.npm root -g
will show the global installation root regardless of current working directory.See the documentation.
Use the
npm root -g
command for find out your globalnpm
path.Example:
From the docs:
You can get your
{prefix}
withnpm config get prefix
. (Useful when you installed node with nvm).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:npm config edit