繁体   English   中英

更新 NPM 包失败

[英]Updating NPM Packages Fails

我的package.json文件:

{
  "name": "...",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@material-ui/core": "^4.12.4",
    "apollo-client": "^1.9.2",
    "bootstrap": "4.0.0-alpha.6",
    "glamor": "^2.20.40",
    "glamorous": "^4.9.1",
    "history": "^4.7.2",
    "jwt-decode": "^2.2.0",
    "lodash": "^4.17.4",
    "moment": "2.18.1",
    "normalize.css": "^7.0.0",
    "polished": "^1.7.0",
    "prop-types": "^15.6.0",
    "qs": "^6.5.1",
    "react": "^17.0.0",
    "react-addons-css-transition-group": "^15.6.2",
    "react-addons-transition-group": "^15.6.2",
    "react-apollo": "^1.4.15",
    "react-bootstrap": "^0.31.3",
    "react-burger-menu": "^3.0.8",
    "react-day-picker": "^6.2.1",
    "react-dom": "^17.0.0",
    "react-loader": "^2.4.2",
    "react-rangeslider": "^2.2.0",
    "react-rating-stars-component": "^2.2.0",
    "react-redux": "^5.0.6",
    "react-router": "^4.2.0",
    "react-router-bootstrap": "^0.24.4",
    "react-router-dom": "^4.2.2",
    "react-scripts": "1.0.14",
    "react-select": "^1.0.0-rc.10",
    "react-stripe-elements": "^1.0.1",
    "react-transition-group": "^2.2.1",
    "reactstrap": "^4.8.0",
    "redux": "^3.7.2",
    "redux-form": "^7.1.0",
    "redux-logger": "^3.0.6",
    "redux-pack": "^0.1.5",
    "redux-thunk": "^2.2.0",
    "revalidate": "^1.2.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "lint": "eslint src",
    "eject": "react-scripts eject"
  },
  "devDependencies": {
    "eslint": "^4.7.2",
    "eslint-config-4catalyzer-react": "^0.3.3",
    "eslint-plugin-import": "^2.7.0",
    "eslint-plugin-jsx-a11y": "^6.6.1",
    "eslint-plugin-react": "^7.4.0"
  }
}

我正在更新我的代码库。

我希望能够更新单个 package,然后测试我的应用程序,然后继续更新另一个 package。

我应该在更新过程中使用什么命令? npm updatenpm install

我尝试npm update redux并收到以下错误:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: react-apollo@1.4.16
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.0" from the root project
npm ERR!   peer react@"^16.8.0 || ^17.0.0" from @material-ui/core@4.12.4
npm ERR!   node_modules/@material-ui/core
npm ERR!     @material-ui/core@"^4.12.4" from the root project
npm ERR!   14 more (react-transition-group, @material-ui/styles, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"0.14.x || 15.* || ^15.0.0 || ^16.0.0" from react-apollo@1.4.16
npm ERR! node_modules/react-apollo
npm ERR!   react-apollo@"^1.4.15" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: react@16.14.0
npm ERR! node_modules/react
npm ERR!   peer react@"0.14.x || 15.* || ^15.0.0 || ^16.0.0" from react-apollo@1.4.16
npm ERR!   node_modules/react-apollo
npm ERR!     react-apollo@"^1.4.15" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

错误究竟是什么意思? 我将如何解决它? 无需--force--legacy-peer-deps

在此错误中,存在 2 个依赖项的兼容性问题。

  1. react-apollo@1.4.16 does not support react 17 version
  2. Material UI v4 正式不支持 React v17

material4 与 react17 不兼容

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM