gpt4 book ai didi

reactjs - 为什么显示错误 [ react-router-dom@5.2.0 需要 react@>=15 的对等方,但没有安装。您必须自己安装对等依赖项。]

转载 作者:行者123 更新时间:2023-12-04 09:37:33 26 4
gpt4 key购买 nike

我想显示使用' react-router-dom 的页面'在 react 。
并显示错误

[react-router-dom@5.2.0 requires a peer of react@>=15 but none isinstalled. You must install peer dependencies yourself.].


但我的 react 版本是 "^16.13.1"已经。
package.json
{
"name": "pra_hook",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

最佳答案

做 [npm install react-router-dom] 并工作

关于reactjs - 为什么显示错误 [ react-router-dom@5.2.0 需要 react@>=15 的对等方,但没有安装。您必须自己安装对等依赖项。],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62494887/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com