为什么我有下面的错误
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发布于 2022-06-29 15:35:19
the google-登录没有更新到最新的the v18。要么等待更新,降低对v17的反应,要么使用-强制标志。
npm i react-google-login --force请注意,通过使用--force,不能保证此包将与v18 of react一起工作。
发布于 2022-06-29 15:43:50
react-google-login@5.2.2与Resive18版本不兼容,因为5.2.2是根据国家预防机制页面。在一年前发布的
它仍然在寻找17 / 16的react版本。下面的错误块将告诉您如下:
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16 || ^17" from react-google-login@5.2.2您可以通过以下方式降低对此特定项目的反应:
npm cache cleannpm installhttps://stackoverflow.com/questions/72803934
复制相似问题