Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find reverse dependencies on npm package?

Tags:

node.js

npm

I'd like to find out which packages depend on express among the installed sails/kraken/loopback/hapi/koa etc. Are there npm sub-commands or other ways to locally list all reverse dependencies on one specific npm package?

like image 367
sof Avatar asked Oct 19 '22 14:10

sof


People also ask

How do I see NPM package dependencies?

Use the npm list to show the installed packages in the current project as a dependency tree. Use npm list --depth=n to show the dependency tree with a specified depth. Use npm list --prod to show packages in the dependencies . Use npm list --dev to show packages in the devDependencies .

Where are npm dependencies stored?

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.

Can you reverse npm update?

You can restore your package. json file to its previous state (hopefully you still have that, or at least remember what you had changed), and then do another npm update .


1 Answers

Adding package name after npm ls will show you tree only with the specified package.

npm ls express
like image 248
hassansin Avatar answered Oct 22 '22 02:10

hassansin