Why is node.js dependency listed as a depdency so many times in my package-lock.json, but never actually required anywhere else in my application?

huangapple go评论60阅读模式
英文:

Why is node.js dependency listed as a depdency so many times in my package-lock.json, but never actually required anywhere else in my application?

问题

I'm new to the node.js world, and have inherited an app that uses the aws-xray-sdk-core library. I've noticed that the npm package minimist is listed as a dependency many times in the package-lock.json file, but when I search to see where the package is actually referenced in the code, it is only showing in the package-lock.json: Why is node.js dependency listed as a depdency so many times in my package-lock.json, but never actually required anywhere else in my application?

Why is this? Is the package not actually used by any of the libraries which list it as a dependency? I'd expect to see it imported using require('minimist') if it were actually being used somewhere.

英文:

I'm new to the node.js world, and have inherited an app that uses the aws-xray-sdk-core library. I've noticed that the npm package minimist is listed as a dependency many times in the package-lock.json file, but when I search to see where the package is actually referenced in the code, it is only showing in the package-lock.json: Why is node.js dependency listed as a depdency so many times in my package-lock.json, but never actually required anywhere else in my application?

Why is this? Is the package not actually used by any of the libraries which list it as a dependency? I'd expect to see it imported using require('minimist') if it were actually being used somewhere.

答案1

得分: 1

你可以运行 npm why minimist 来查找需要它的原因。肯定有其他依赖项依赖于它。

如果你特别关心这个,你可能希望运行 npm why @types/minimist

英文:

You can npm why minimist to find out what's requiring it. It's surely there because another dependency depends on it.

More specifically you may wish to run npm why @types/minimist if you're concerned about that in particular.

huangapple
  • 本文由 发表于 2023年5月18日 08:01:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/76276903.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定