node.jsnpm

NPM: Why is this package installed?


How do I determine why a particular package is installed? In other words, what package(s) depend on this package?

The package in question is babelify. npm ls shows it at the top level, but it is not included in package.json anywhere.


Solution

  • Use npm ls to list installed packages and see the dependency graph of a given package eg:

    > npm ls core-js
    
    my_module /path/to/my_module>
    └─┬ pug@2.0.4
      └─┬ pug-code-gen@2.0.2
        └─┬ constantinople@3.1.2
          └─┬ babel-types@6.26.0
            └─┬ babel-runtime@6.26.0
              └── core-js@2.6.10