【发布时间】:2022-06-11 04:00:22
【问题描述】:
在heroku中部署构建时,会导致依赖错误,有没有人遇到过同样的情况?根本原因是什么?有什么办法解决这个问题吗? 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: next@12.1.6
remote: npm ERR! Found: react@16.14.0
remote: npm ERR! node_modules/react
remote: npm ERR! react@"^16.10.1" from the root project
remote: npm ERR! peer react@"^16.8.0" from @apollo/react-common@3.1.4
remote: npm ERR! node_modules/@apollo/react-common
remote: npm ERR! @apollo/react-common@"^3.1.4" from @apollo/react-components@3.1.5
remote: npm ERR! node_modules/@apollo/react-components
remote: npm ERR! @apollo/react-components@"^3.1.5" from @apollo/react-hoc@3.1.5
remote: npm ERR! node_modules/@apollo/react-hoc
remote: npm ERR! @apollo/react-hoc@"^3.1.5" from react-apollo@3.1.5
remote: npm ERR! node_modules/react-apollo
remote: npm ERR! 1 more (react-apollo)
remote: npm ERR! @apollo/react-common@"^3.1.4" from @apollo/react-hoc@3.1.5
remote: npm ERR! node_modules/@apollo/react-hoc
remote: npm ERR! @apollo/react-hoc@"^3.1.5" from react-apollo@3.1.5
remote: npm ERR! node_modules/react-apollo
remote: npm ERR! react-apollo@"^3.1.3" from the root project
remote: npm ERR! 3 more (@apollo/react-hooks, @apollo/react-ssr, react-apollo)
remote: npm ERR! 14 more (@apollo/react-components, @apollo/react-hoc, ...)
remote: npm ERR!
remote: npm ERR! Could not resolve dependency:
remote: npm ERR! peer react@"^17.0.2 || ^18.0.0-0" from next@12.1.6
remote: npm ERR! node_modules/next
remote: npm ERR! next@"^12.1.6" from the root project
remote: npm ERR! peer next@">= 5.1.0" from next-env@1.1.1
remote: npm ERR! node_modules/next-env
remote: npm ERR! next-env@"^1.1.0" from the root project
remote: npm ERR!
remote: npm ERR! Conflicting peer dependency: react@18.1.0
remote: npm ERR! node_modules/react
remote: npm ERR! peer react@"^17.0.2 || ^18.0.0-0" from next@12.1.6
remote: npm ERR! node_modules/next
remote: npm ERR! next@"^12.1.6" from the root project
remote: npm ERR! peer next@">= 5.1.0" from next-env@1.1.1
remote: npm ERR! node_modules/next-env
remote: npm ERR! next-env@"^1.1.0" 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.KnKS4/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.KnKS4/_logs/2022-06-03T12_47_36_545Z-debug-0.log
remote:
remote: -----> Build failed
【问题讨论】: