npm 如何使用Yarn更新依赖项的依赖项

vlf7wbxs  于 2023-01-13  发布在  Yarn
关注(0)|答案(1)|浏览(244)

我用的是react-admin v3.1.4,我试着升级到v4,但是太难了。所以,当我试着回到以前的版本时,我发现了一个问题,这个问题没有运行。这是由于mui的版本与更新前的版本不同而引起的。我已经为此挣扎了好几天了。请帮助!

问题

因此,我想做的是更改嵌套的@material-ui/icons版本。

我想将react-admin的@material-ui/icons版本v4.11.3更改为v.4.2.1(之前版本)
这是我依赖的一部分。

├─ @material-ui/icons@4.2.1
└─ react-admin@3.1.4
   └─ @material-ui/icons@4.11.3 => ToDo : change to v4.2.1

我已经试过了。
1.删除node_modulesyarn install

  1. yarn upgrade --depth 5
    这是我的包. json
"dependencies": {
    "@elastic/react-search-ui": "^1.7.0",
    "@elastic/search-ui-app-search-connector": "^1.7.0",
    "@material-ui/core": "4.3.3",
    "@material-ui/icons": "4.2.1",
    "@material-ui/lab": "^4.0.0-alpha.39",
    "@material-ui/styles": "^4.3.3",
    "@redkiwi/shared": "^1.0.3",
    "axios": "^0.19.2",
    "babel-eslint": "10.0.1",
    "classnames": "^2.2.6",
    "final-form": "4.18.5",
    "final-form-arrays": "3.0.1",
    "firebase": "^7.14.1",
    "graphql": "^14.5.8",
    "graphql-tag": "^2.10.1",
    "husky": "^4.2.1",
    "lerna": "^3.20.2",
    "lodash": "^4.17.15",
    "moment": "^2.24.0",
    "prop-types": "^15.7.2",
    "query-string": "^6.8.2",
    "ra-core": "3.1.2",
    "ra-data-json-server": "^3.0.2",
    "ra-i18n-polyglot": "^3.2.2",
    "ra-language-english": "^3.2.0",
    "ra-ui-materialui": "^3.1.2",
    "react": "^16.9.0",
    "react-admin": "3.1.4",
    "react-dom": "^16.9.0",
    "react-final-form": "^6.3.3",
    "react-final-form-arrays": "^3.1.1",
    "react-router-dom": "^5.1.2",
    "react-scripts": "3.4.1",
    "react-scroll-up": "^1.3.3",
    "react-transition-group": "^4.3.0",
    "recompose": "^0.30.0",
    "redux-form": "7.4.0",
    "shallowequal": "^1.1.0"
  },
w1e3prcc

w1e3prcc1#

您可以添加分辨率到您的package.json

"resolutions": {
    "@material-ui/icons": "^4.2.1"
}

更多详情:Selective dependency resolutions

相关问题