react-native - 无法为react-native 17.0.1安装material-ui/core

标签 react-native npm material-ui

有人能够澄清为什么它没有按应有的方式安装吗?

$ npm install @material-ui/core

以下是日志:

...

29 http fetch GET 304 https://registry.npmjs.org/react 125ms (from cache)
30 timing idealTree Completed in 2086ms
31 timing command:install Completed in 2090ms
32 verbose stack Error: unable to resolve dependency tree
32 verbose stack     at Arborist.[failPeerConflict] (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:1011:25)
32 verbose stack     at Arborist.[loadPeerSet] (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:991:36)
36 verbose node v15.0.0
37 verbose npm  v7.0.2
38 error code ERESOLVE
39 error ERESOLVE unable to resolve dependency tree
40 error
41 error While resolving: [1mamazon-clone[22m@[1m0.1.0[22m
41 error Found: [1mreact[22m@[1m17.0.1[22m[2m[22m
41 error [2mnode_modules/react[22m
41 error   [1mreact[22m@"[1m^17.0.1[22m" from the root project
41 error
41 error Could not resolve dependency:
41 error [35mpeer[39m [1mreact[22m@"[1m^16.8.0[22m" from [1m@material-ui/core[22m@[1m4.11.0[22m[2m[22m
41 error [2mnode_modules/@material-ui/core[22m
41 error   [1m@material-ui/core[22m@"[1m*[22m" from the root project
41 error
41 error Fix the upstream dependency conflict, or retry
41 error this command with --force, or --legacy-peer-deps
41 error to accept an incorrect (and potentially broken) dependency resolution.

我得到了上面的日志 block ,它们可以告诉我们到底发生了什么。

最佳答案

看起来这篇文章有您的解决方案:

https://github.com/npm/cli/issues/2000 。看起来像是最近出现的 eslint 依赖问题

关于react-native - 无法为react-native 17.0.1安装material-ui/core,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64547511/

相关文章:

java - 如何修复 RN 中的 `cannot be cast to java.lang.String`?

ios - React Native 和 iOS 分享按钮

html - 如何从 Node 包中包含 css/js 文件?

node.js - 永远永远监控

javascript - npm update v5.4.2 后 ./node_modules/react-router-dom 中找不到模块错误

javascript - Material UI 自定义主题颜色分配 Typescript

javascript - 使用 mobx-react-lite 和 React hooks 在 React Native 中获取函数

android - 无法使用 react-native 在 Android 上呈现具有绝对位置的 View

node.js - npm 的包审计使用 OWASP 吗?

reactjs - 迁移到 material-ui v4,我收到 Modal 组件的警告