无法使用 npm 命令安装 Radium

问题描述 投票:0回答:1

命令

npm install --save radium

错误

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^18.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0 || ^17.0.0" from [email protected]
npm ERR! node_modules/radium
npm ERR!   radium@"*" 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\Max\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\Max\AppData\Local\npm-cache\_logs\2022-09-09T12_51_53_580Z-debug-0.log

注意:我正在尝试安装 Radium,但显示此错误。我不知道为什么。

node.js reactjs npm npm-install radium
1个回答
2
投票

尝试删除您的

node_modules
并再次运行
npm install
,这是安装出错的常见问题。

rm -rf node_modules/
npm install --save radium --force

此命令将删除

node_modules
,然后安装
package.json
文件中的依赖项并安装 radium 库。

© www.soinside.com 2019 - 2024. All rights reserved.