首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我要解决package.jason文件错误吗?

我要解决package.jason文件错误吗?
EN

Stack Overflow用户
提问于 2022-06-29 15:19:27
回答 2查看 162关注 0票数 0

为什么我有下面的错误

代码语言:javascript
复制
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: shareme_frontend@0.1.0
npm ERR! Found: react@18.2.0
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 react-google-login@5.2.2
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
EN

回答 2

Stack Overflow用户

发布于 2022-06-29 15:35:19

the google-登录没有更新到最新的the v18。要么等待更新,降低对v17的反应,要么使用-强制标志。

代码语言:javascript
复制
npm i react-google-login --force

请注意,通过使用--force,不能保证此包将与v18 of react一起工作。

票数 0
EN

Stack Overflow用户

发布于 2022-06-29 15:43:50

react-google-login@5.2.2与Resive18版本不兼容,因为5.2.2是根据国家预防机制页面。在一年前发布的

它仍然在寻找17 / 16的react版本。下面的错误块将告诉您如下:

代码语言:javascript
复制
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16 || ^17" from react-google-login@5.2.2

您可以通过以下方式降低对此特定项目的反应:

  1. 删除node_modules
  2. 运行npm cache clean
  3. 手动更新您的package.json以将react的版本更改为17
  4. 运行npm install
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72803934

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档