英文:
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 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 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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论