因此,我必须使用 npm i react-google-login --force
将 Google 登录组件安装到我的本地机器上,在 Heroku 上使用 GitHub 进行 ci/cd,但它拒绝在 Heroku 上安装 react-google-login 组件。请问我该如何在 Heroku 上使用 npm I react-google-login --force
? 下面是我部署时收到的错误信息。
-----> Installing dependencies
remote: Installing node modules
remote: npm ERR! code ERESOLVE
remote: npm ERR! ERESOLVE could not resolve
remote: npm ERR!
remote: npm ERR! While resolving: react-google-login@5.2.2
remote: npm ERR! Found: react@18.2.0
remote: npm ERR! node_modules/react
remote: npm ERR! react@"^18.1.0" from the root project
remote: npm ERR! peer react@"^16 || ^17 || ^18" from @headlessui/react@1.6.5
remote: npm ERR! node_modules/@headlessui/react
remote: npm ERR! @headlessui/react@"^1.6.4" from the root project
remote: npm ERR! 11 more (@heroicons/react, @testing-library/react, formik, ...)
remote: npm ERR!
remote: npm ERR! Could not resolve dependency:
remote: npm ERR! peer react@"^16 || ^17" from react-google-login@5.2.2
remote: npm ERR! node_modules/react-google-login
remote: npm ERR! react-google-login@"^5.2.2" from the root project
remote: npm ERR!
remote: npm ERR! Conflicting peer dependency: react@17.0.2
remote: npm ERR! node_modules/react
remote: npm ERR! peer react@"^16 || ^17" from react-google-login@5.2.2
remote: npm ERR! node_modules/react-google-login
remote: npm ERR! react-google-login@"^5.2.2" from the root project
remote: npm ERR!
remote: npm ERR! Fix the upstream dependency conflict, or retry
remote: npm ERR! this command with --force, or --legacy-peer-deps
remote: npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
remote: npm ERR!
remote: npm ERR! See /tmp/npmcache.7FR4A/eresolve-report.txt for a full report.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.7FR4A/_logs/2022-07-11T20_31_06_507Z-debug-0.log
remote:
remote: -----> Build failed
.npmrc
文件,只有一个workflow.yaml文件,我可以创建一个吗?它应该放在哪里? - Ayofayomi