使用redux-form和reat-redux进行错误的对等依赖

时间:2017-09-21 15:03:39

标签: reactjs redux-form yarnpkg

每当我使用以下package.json运行yarn install yarn install

  "dependencies": {
    "font-awesome": "4.7.0",
    "immutable": "3.8.1",
    "lodash": "^4.17.4",
    "object-assign": "4.1.1",
    "promise": "7.1.1",
    "react-fontawesome": "1.6.1",
    "react-router": "^4.1.1",
    "react-router-dom": "^4.1.1",
    "react-redux": "^5.0.6",
    "react-fontawesome": "1.6.1",
    "redux": "3.7.1",
    "redux-api": "0.10.8",
    "redux-logger": "^3.0.6",
    "redux-form": "^7.0.4",
    "redux-thunk": "2.2.0",
    "whatwg-fetch": "2.0.3"
  },

我收到以下警告:

warning "ajv-keywords@1.5.1" has incorrect peer dependency "ajv@>=4.10.0".
warning "redux-form@7.0.4" has incorrect peer dependency "react-redux@^4.3.0 || ^5.0.0".

当我引用react-redux@^4.3.0 || ^5.0.0时,我不明白为什么抱怨react-redux@5.0.6

1 个答案:

答案 0 :(得分:0)

Pull Request #3803在修复Bug #3710时引入了这种行为,其中对等依赖关系仅从其兄弟和存储库根目录中解析,而不是更高级别。引用相同代码的不同目录级别的模块可能需要不同的版本。 Pull Request #4478code change here)更新了纱线逻辑,以解决更高级别的对等依赖关系。

将Yarn与您的包一起更新,您应该停止看到错误。

另外,避免使用npm upgrade命令获取最新版本的纱线 - 使用npm install。

npm install -g yarn