gpt4 book ai didi

node.js - 无法消除 yarn 不正确的对等依赖警告

转载 作者:太空宇宙 更新时间:2023-11-04 01:38:42 24 4
gpt4 key购买 nike

运行 yarn Upgrade 并在 package.json 中安装对等依赖项后,我无法摆脱警告。我了解警告 won't actually stop my code from running ,但我想尽量减少它们,这样就不会出现警告,并且干净的安装看起来不错。

这是我的 package.json

{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"eject": "expo eject",
"test": "node ./node_modules/jest/bin/jest.js --watchAll"
},
"jest": {
"preset": "jest-expo"
},
"peerDependencies": {
"react": "16.0.0-alpha.6",
"react-native": "^0.44.1",
"@babel/core": "^7.0.0-0"
},
"dependencies": {
"@babel/core": "^7.0.0-0",
"@expo/samples": "2.1.1",
"expo": "^31.0.2",
"react-navigation": "^2.18.2",
"react-redux": "^6.0.0",
"redux": "^4.0.1"
},
"devDependencies": {
"babel-preset-expo": "^5.0.0",
"install-peers": "^1.0.3",
"jest-expo": "^31.0.0",
"prop-types": "^15.0.0",
"react": "^16.6.3",
"react-native": "^0.57.1"
},
"private": true
}

终端:

$ trash yarn.lock; trash node_modules; yarn
yarn install v1.12.3
info No lockfile found.
[1/4] 🔍 Resolving packages...
warning jest-expo > jest > jest-cli > prompts > kleur@2.0.2: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <https://github.com/lukeed/kleur/releases/tag/v3.0.0\> for migration path(s).
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
warning "expo > react-native-reanimated@1.0.0-alpha.10" has incorrect peer dependency "react@16.0.0-alpha.6".
warning "expo > react-native-reanimated@1.0.0-alpha.10" has incorrect peer dependency "react-native@^0.44.1".
warning " > react-native@0.57.7" has incorrect peer dependency "react@16.6.1".
[4/4] 📃 Building fresh packages...
success Saved lockfile.
✨ Done in 19.19s.

最佳答案

例如,要消除此警告:

react-native@0.57.7" has incorrect peer dependency "react@16.6.1"

尝试命令

npm install react@16.6.1

因为react-native依赖于react的特定版本。

关于node.js - 无法消除 yarn 不正确的对等依赖警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53686161/

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