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
/usr/lib/node_modules
On windows I used
npm list -g
to find out by default my (global) packages were being installed toC:\Users\[Username]\AppData\Roaming\npm
.You can find globally installed modules by the command
It will provide you the location where node.js modules have been installed.
If you install node.js modules locally in a folder, you can type the following command to see the location.
For globally-installed modules:
The other answers give you platform-specific responses, but a generic one is this:
When you install global module with
npm install -g something
, npm looks up a config variableprefix
to know where to install the module.You can get that value by running
npm config get prefix
To display all the global modules available in that folder use
npm ls -g --depth 0
(depth 0
to not display their dependencies).If you want to change the global modules path, use
npm config edit
and putprefix = /my/npm/global/modules/prefix
in the file.When you use some tools like nodist, they change the platform-default installation path of global npm modules.
The easiest way would be to do
to list the package and view their installed location.
I had installed npm via chololatey, so the location is
C:\MyProgramData\chocolatey\lib\nodejs.commandline.0.10.31\tools\node_modules
C:\MyProgramData\ is chocolatey repo location.
In earlier versions of NPM modules were always placed in /usr/local/lib/node or wherever you specified the npm root within the .npmrc file. However, in NPM 1.0+ modules are installed in two places. You can have modules installed local to your application in /.node_modules or you can have them installed globally which will use the above.
More information can be found at https://github.com/isaacs/npm/blob/master/doc/install.md