Heroku部署失败?可能是因为依赖关系


remote: -----> 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-rss@2.0.1
remote:        npm ERR! Found: react@18.2.0
remote:        npm ERR! node_modules/react
remote:        npm ERR!   react@"^18.2.0" from the root project
remote:        npm ERR!   peer react@"^18.0.0" from @testing-library/react@13.4.0
remote:        npm ERR!   node_modules/@testing-library/react
remote:        npm ERR!     @testing-library/react@"^13.4.0" from the root project
remote:        npm ERR!   4 more (react-dom, react-router, react-router-dom, react-scripts)
remote:        npm ERR!
remote:        npm ERR! Could not resolve dependency:
remote:        npm ERR! peer react@"^16.13.1" from react-rss@2.0.1
remote:        npm ERR! node_modules/react-rss
remote:        npm ERR!   react-rss@"^2.0.1" from the root project
remote:        npm ERR!
remote:        npm ERR! Conflicting peer dependency: react@16.14.0
remote:        npm ERR! node_modules/react
remote:        npm ERR!   peer react@"^16.13.1" from react-rss@2.0.1
remote:        npm ERR!   node_modules/react-rss
remote:        npm ERR!     react-rss@"^2.0.1" 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.zVSUf/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.zVSUf/_logs/2022-11-03T19_15_38_788Z-debug-0.log
remote: 
remote: -----> Build failed
remote:        
remote:        We're sorry this build is failing! You can troubleshoot common issues here:
remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote:        Some possible problems:
remote:
remote:        - Node version not specified in package.json
remote:          https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
remote:
remote:        Love,
remote:        Heroku
remote:
remote:  !     Push rejected, failed to compile Node.js app.
remote: 
remote:  !     Push failed
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: ea132e7d82ff4a3fe3121b0858e49a2c8336bec0
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version ea132e7d82ff4a3fe3121b0858e49a2c8336bec0
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote:  !
remote:  ! If you are developing on a branch and deploying via git you must run:
remote:  !
remote:  !     git push heroku <branchname>:main
remote:  !
remote:  ! This article goes into details on the behavior:
remote:  !   https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote: 
remote: !       Push rejected to tb-work-hub.
remote:
To https://git.heroku.com/tb-work-hub.git
! [remote rejected] master -> master (pre-receive hook declined)

我不明白。昨天天气很好。我猜这与我试图处理的一些依赖关系有关?

如果没有一个干净的解决方案,有没有一个好的方法可以恢复我的应用程序,而不必重新启动、重新安装所有内容并复制粘贴src?

尝试:npm卸载反应rss

转到Heroku中的应用程序->设置->显示配置变量

添加一个新的配置变量,其关键字为:NPM_config_LEGACY_PEER_DEPS,值为true,然后重新部署。

(Heroku Shopify应用程序错误';npm ERR!ERESOLVE无法解析依赖树';(

我希望它能起作用。

相关内容

最新更新