How to find reverse dependencies on npm package?
I specifically wanted to find what package used a dependency that was breaking an initial install. This may help somebody out trying todo the same:
find ./node_modules/ -name package.json | xargs grep <the_package_name>
In case someone is using pnpm, this should help to find packages that depend on lodash for example:
pnpm list --depth 1 | grep --color -E '(^\w|\slodash)'
Adding package name after npm ls
will show you tree only with the specified package.
npm ls express