我是否解析package.jason文件错误?

发布于 2025-02-11 16:08:26 字数 1590 浏览 1 评论 0 原文

为什么我有以下错误

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

Why am I having the below error

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

猫九 2025-02-18 16:08:27

npm页。

仍在寻找17 /16的React版本。
以下错误块将告诉您:

npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16 || ^17" from [email protected]

降低此特定项目的反应

  1. 您可以通过:

    删除node_modules

  2. 运行 npm缓存清洁

  3. 手动更新您的软件包。

  4. 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:

npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16 || ^17" from [email protected]

You can downgrade your react for this specific project via :

  1. deleting node_modules

  2. run npm cache clean

  3. manually update your package.json to change version of react to 17

  4. run npm install

心病无药医 2025-02-18 16:08:27

您可以使用此命令通过命令行安装:

npm install @sanity/client @sanity/image-url react-google-login react-icons react-loader-spinner react-masonry-css react-router-dom uui --force  

You can use this command to install via the command line:

npm install @sanity/client @sanity/image-url react-google-login react-icons react-loader-spinner react-masonry-css react-router-dom uui --force  
可遇━不可求 2025-02-18 16:08:26

React-Google-Login未更新为最新的React V18。
要么等待更新,要么降级对v17反应,要么使用 - force标志。

npm i react-google-login --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.

npm i react-google-login --force

Note that by using --force, there is no guarantee that this package will work with v18 of react

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文