我是否解析package.jason文件错误?
为什么我有以下错误
PS C:\Users\USER\Desktop\Shareme\shareme_frontend> npm install @sanity/client @sanity/image-url react-google-login react-icons react-loader-spinner react-masonry-css react-router-dom uuid
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
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 || ^17" from [email protected]
npm ERR! node_modules/react-google-login
npm ERR! react-google-login@"*" 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\USER\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\USER\AppData\Local\npm-cache\_logs\2022-06-29T15_11_18_949Z-debug-0.log
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
npm页。
仍在寻找17 /16的React版本。
以下错误块将告诉您:
降低此特定项目的反应
删除node_modules
运行
npm缓存清洁
手动更新您的软件包。
Run
npm install
[email protected]
is not compatible with react 18 version as 5.2.2 is published year ago as per npm page.It is still looking for react version of 17 / 16.
Below error block will tell you this:
You can downgrade your react for this specific project via :
deleting node_modules
run
npm cache clean
manually update your package.json to change version of react to 17
run
npm install
您可以使用此命令通过命令行安装:
You can use this command to install via the command line:
React-Google-Login未更新为最新的React V18。
要么等待更新,要么降级对v17反应,要么使用 - force标志。
请注意,通过使用 - 力量,不能保证此软件包将与React的V18一起使用
react-google-login is not updated to the latest react v18.
Either wait for an update, downgrade react to v17, or use --force flag.
Note that by using --force, there is no guarantee that this package will work with v18 of react