Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find what npm package has a particular dependency?

My webpack project has a new error:

Browserslist: caniuse-lite is outdated. Please run next command npm update caniuse-lite browserslist

Which I haven't solved yet, but the underlying problem is: I don't have caniuse-lite in my package.json - so where is it?

btw: running that command makes no difference.

It's obviously a dependency or a dependency of a dependency, ad infinitum...

npmjs caniuse-lite lists 80 dependent packages.

Is there a way to search the dependency graph of packages to easily find what package in my package.json file is the parent that somewhere along the line depends on caniuse-lite?

like image 696
Dave Avatar asked Mar 11 '19 09:03

Dave


People also ask

How npm install specific dependencies?

For npm install specific version, use npm install [package-name]@[version-number]. Use npm view [package-name] version to know the specific latest version of a package available on the npm registry. Use npm list [package-name] to know the specific latest version of an installed package.

How do I know if npm dependency is installed?

To discover npm version checks are currently installed in your project, run npm list. All the npm modules available are: the latest version of [email protected].

Where are npm dependencies stored?

on windows: c/Program\ Files/nodejs/node_modules/npm/npmrc.

How do I list all npm global packages?

To view the npm global packages list and their dependencies, you can run the following npm list command followed by the “-g” flag where g stands for global. As you can see in the above result, all the global packages are displayed in a tree-like structure.


1 Answers

You can easily check that by following way.

Checkout more here : https://docs.npmjs.com/cli/ls

npm ls contextify

[email protected] /home/zorbash/some-project
└─┬ [email protected]
  └─┬ [email protected]
    └── [email protected]
like image 184
Mayank Dudakiya Avatar answered Mar 23 '23 05:03

Mayank Dudakiya