gpt4 book ai didi

dependencies - 有没有安装依赖项的对等依赖项的方法?

转载 作者:行者123 更新时间:2023-12-04 17:15:30 26 4
gpt4 key购买 nike

在运行 npm install 时,我们得到:

npm WARN ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself
我们最初认为问题是需要安装提到的对等依赖项 - ajv - 但这并没有解决问题。
重要的是简单地理解这个问题。鉴于我们确实满足了 AFAICT 的依赖关系,错误消息甚至意味着什么?
package.json 有这个:
  "dependencies": {
"ajv": "^6.0.0"
},
package-lock.json 有这个:
    "ajv": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.2.1.tgz",
"integrity": "sha1-KKarxJOiq+D7TIUHrK7bQ/pVBnE=",
"requires": {
"fast-deep-equal": "1.1.0",
"fast-json-stable-stringify": "2.0.0",
"json-schema-traverse": "0.3.1"
}
},
"ajv-keywords": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz",
"integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=",
"dev": true
}
npm-install-peers
This package doesn't seem to have any peerDependencies
该工具的维护者说

It's designed to install the direct peer dependencies of your project,not the peer dependencies of your dependencies


这意味着问题是比顶层更深的依赖。
有没有安装依赖的依赖的工具?

最佳答案

安装请求的特定 AJV 版本:

npm install ajv@^5.0.0 --save

( ^ 确保仅为软件包安装较小的、向后兼容的更新,例如 5.1.0)

关于dependencies - 有没有安装依赖项的对等依赖项的方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49263196/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com