Check why a package is installed
In general, there are lots of packages in node_modules
, but only few is wrote to package.json
file. Cause these dependencies required other dependencies.
It is necessary to make clear these dependencies’ relation when you want to upgrade package version.
If you use yarn
to install your dependencies, you can use yarn why [package]
to get their relation.
e.g.
While for npm
, there is no command like yarn why
, you can use the package npm-why
to do this, Usage: npx npm-why [package]
.
e.g.
Now, you can get the relation between dependencies by these two ways.
π Please leave your comment if you like this.π