我在使用NPM中安装材料-UI时会遇到以下错误,该怎么办?

发布于 2025-02-06 10:48:06 字数 770 浏览 2 评论 0原文

npm err! node_modules/react npm err! React@“^18.1.0”来自root Project npm err! npm err!无法解决依赖性: npm err! peer react @“ ^16.8.0 || ^17.0.0” from @Metital-ui/” [电子邮件 受保护] npm err! node_modules/@材料-UI/core npm err! @youteral-ui/core@“*” root项目 npm err! npm err!修复上游依赖冲突或重试 npm err!此命令带有 - 法或 - 掌控式deps npm err!接受不正确(并可能破坏)依赖性解决方案。 npm err! npm err!请参阅C:\ users \ Ayush Tawar \ AppData \ local \ npm-cache \ eresolve-report.txt,以获取完整报告。 npm err!可以在以下方式中找到此运行的完整日志 npm err! C:\ Users \ Ayush Tawar \ AppData \ local \ npm-cache_logs \ 2022-06-10T07_31_31_54_848Z-DEBUG-0.LOG PS C:\ USER \ Ayush Tawar \ OneDrive \ Desktop \ Twitter Clone>

npm ERR! node_modules/react
npm ERR! react@"^18.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0 || ^17.0.0" from @material-ui/[email protected]
npm ERR! node_modules/@material-ui/core
npm ERR! @material-ui/core@"*" 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.
npm ERR!
npm ERR! See C:\Users\ayush tawar\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ayush tawar\AppData\Local\npm-cache_logs\2022-06-10T07_31_54_848Z-debug-0.log
PS C:\Users\ayush tawar\OneDrive\Desktop\twitter clone>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

怪我闹别瞎闹 2025-02-13 10:48:06

请尝试这样做
npm缓存清洁

,然后

npm install -g node-gyp
npm install --g --production windows-build-tools

错误使用npm安装bcrypt

还可以在npm install的末尾添加- 冗长标志,它将显示更多
有关此问题的信息。
如果第二个命令无法正常工作,则应将Python安装到PC上并安装该命令。

npm install --g  windows-build-tools

我相信,如果您将使用Ubuntu或Mac OS,则可能会解决。

或者可能是节点版本问题,请升级节点版本。

Please try to do like this
npm cache clean

and then

npm install -g node-gyp
npm install --g --production windows-build-tools

Error installing bcrypt with npm

You can also add --verbose flag at the end of npm install which will show more
information about this issue.
if second command will not work, then you should install python to your pc and install this one.

npm install --g  windows-build-tools

I believe if you will use ubuntu or mac os, it will be resolved maybe.

Or it could be node version issue, please upgrade node version.

阳光下的泡沫是彩色的 2025-02-13 10:48:06

该包并非最新的React 18。
只需使用-Legacy-Peer-Deps安装它,这将覆盖错误检查。

npm install @材料 - ui/core- legacy-peer-deps

The package is not up to date for react 18.
Just install it with --legacy-peer-deps, this will override the error checking.

npm install @material-ui/core --legacy-peer-deps

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文