我在试一个React/还原/离子应用程序。
当我运行npm install
时,我得到错误:
>`enter code here`npm install
npm WARN @ionic/react@0.0.5 requires a peer of react-router@^4.3.1 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic/react@0.0.5 requires a peer of react-router-dom@^4.3.1 but none is installed. You must install peer dependencies yourself.
但是,当我查看package.json
时,它看起来确实应该安装react-router
和react-router-dom
:
"@ionic/react": "0.0.5",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-redux": "^7.0.3",
"react-router": "^5.0.0",
"react-router-dom": "^5.0.0",
"react-scripts": "3.0.1",
"redux": "^4.0.1",
你知道这是怎么回事吗?
2条答案
按热度按时间f3temu5u1#
查看警告消息提供的版本,您需要卸载较新的版本,然后重新安装专门提供的版本卸载:
(as进行健全性检查,查看package.json以确认已删除),然后安装警告中提供的特定所需版本
l0oc07j22#
您可以尝试清除该高速缓存并重新安装:
第一个月
npm install