英文:
unable to find version npm react
问题
以下是错误信息,
无法解析依赖树
npm ERR! 找到: react-dnd@9.5.1
npm ERR! node_modules/react-dnd
npm ERR! react-dnd@^9.4.0 来自根项目
npm ERR!
npm ERR! 无法解析依赖:
npm ERR! peer react-dnd@">= 2.0.0 < 3.0.0" 来自 reactabular-dnd@8.16.0
以下是我正在使用的包,
"reactabular-dnd": "^8.16.0",
"react-dnd": "^9.4.0",
有人可以帮助我吗?它说 reactabular-dnd@8.16.0 需要 react-dnd 版本小于 3,但我需要最新的 react-dnd。
英文:
below is the error,
unable to resolve dependency tree
npm ERR! Found: react-dnd@9.5.1
npm ERR! node_modules/react-dnd
npm ERR! react-dnd@"^9.4.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-dnd@">= 2.0.0 < 3.0.0" from reactabular-dnd@8.16.0
below are the pacakges am using,
"reactabular-dnd": "^8.16.0",
"react-dnd": "^9.4.0",
Can anyone help me with this? it says reactabular-dnd@8.16.0 requires react-dnd version less than 3 but i require latest react-dnd too
答案1
得分: 1
reactabular-dnd
这个库已经相当过时(最后一次发布是4年前),需要一个低于< 3.0.0
的react-dnd
版本。而你的react-dnd
版本是9.4.0
,明显高于所需版本。
降级react-dnd
可能会起作用,但这可能不是你想要的。通过使用npm install --legacy-peer-deps
来安装,可以忽略这个错误,也许reactabular-dnd
会在较新版本的react-dnd
上正常工作。你也可以尝试overrides。
英文:
reactabular-dnd
which is pretty outdated (last publish 4 years ago) requires a react-dnd
version below < 3.0.0
. Yours is at 9.4.0
way above what's required.
Downgrading react-dnd
would work, but this is not what you want. Installing with npm install --legacy-peer-deps
should ignore the error and possibly reactabular-dnd
will just work fine with a newer version of react-dnd
. You can also try overrides.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论