首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Npm依赖性问题: and 17.0.2和“react可滑动-视图”:"0.13.9“

Npm依赖性问题: and 17.0.2和“react可滑动-视图”:"0.13.9“
EN

Stack Overflow用户
提问于 2021-07-29 09:22:07
回答 1查看 2.4K关注 0票数 0

我正在尝试安装材料仪表板

代码语言:javascript
复制
git clone https://github.com/creativetimofficial/material-dashboard-react.git.

使用node-16

我运行npm install

我得到了

代码语言:javascript
复制
npm ERR! While resolving: material-dashboard-react@1.10.0
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"17.0.2" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^15.3.0 || ^16.0.0" from react-swipeable-views@0.13.9
npm ERR! node_modules/react-swipeable-views
npm ERR!   react-swipeable-views@"0.13.9" 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 /home/simha/.npm/eresolve-report.txt for a full report.

我该怎么解决这个问题。

EN

回答 1

Stack Overflow用户

发布于 2021-07-29 17:56:45

看起来根项目安装了@17.0.2。但“反应-可滑动-视图”要求版本15或16的反应。

编辑:作为第一种选择,您可以尝试将“react swipeable view”更新到它的最新版本。它可能支持React 17,下面的命令将更新它。

代码语言:javascript
复制
npm install react-swipeable-views@latest

如果这不管用..。

尝试将package.json中的react数减少到16.x.x范围内的某个值,然后重新运行

代码语言:javascript
复制
npm install

因此,它将满足对等依赖。

https://docs.npmjs.com/about-semantic-versioning

如果您不熟悉NPM语义版本控制,请使用此计算器。输入react -> "^16.0.0“以确保它不包括17

https://semver.npmjs.com/

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68573360

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档