如何在heroku上安装NPM--force

uinbv5nw  于 9个月前  发布在  其他
关注(0)|答案(1)|浏览(120)

所以我必须使用npm i react-google-login --force来安装谷歌登录组件到我的本地机器上,我在Heroku上使用ci/cd连接了我的GitHub,但它拒绝在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: [email protected]        
remote:        npm ERR! Found: [email protected]        
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/[email protected]        
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 [email protected]        
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: [email protected]        
remote:        npm ERR! node_modules/react        
remote:        npm ERR!   peer react@"^16 || ^17" from [email protected]        
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

字符串

mdfafbf1

mdfafbf11#

将此选项放在您的存储库的.npmrc中:

force=true

字符串
或者,回到npm的松散对等依赖检查:

legacy-peer-deps=true

相关问题