首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法消除纱线不正确的对等依赖警告

无法消除纱线不正确的对等依赖警告
EN

Stack Overflow用户
提问于 2018-12-08 19:30:02
回答 1查看 7.4K关注 0票数 2

在运行yarn upgrade并在我的package.json中安装对等依赖项之后,我无法消除警告。我理解警告won't actually stop my code from running,但我想尽可能地最小化它们,这样就没有警告,并且干净的安装看起来不错。

这里是我的package.json

代码语言:javascript
复制
{
  "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
}

终端:

代码语言:javascript
复制
$ 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.
EN

回答 1

Stack Overflow用户

发布于 2019-03-13 09:13:07

要消除此警告,例如:

react本机@0.57.7有不正确的对等依赖关系“peer @16.6.1”

尝试命令

代码语言:javascript
复制
npm install react@16.6.1

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53686161

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档