npm AWS扩增部署失败

6yoyoihd  于 2022-12-27  发布在  其他
关注(0)|答案(1)|浏览(151)

我试图更新我的AWS Amplify应用程序,我得到这个错误,我不知道什么是错的,一切都很好地在本地工作。我一直试图扫描此日志,看看我是否可以理解它的任何东西,但我找不到什么是错的。它成功地构建后端和失败后,前端预构建。我尝试重新部署以前的成功部署,但他们都失败了,以及,这让我更加困惑。以下是日志:'

2022-11-17T22:49:16.082Z [INFO]: ## Starting Frontend Build
                                 # Starting phase: preBuild
2022-11-17T22:49:16.082Z [INFO]: # Executing command: npm ci
2022-11-17T22:49:20.209Z [WARNING]: npm
2022-11-17T22:49:20.211Z [WARNING]: WARN ERESOLVE overriding peer dependency
                                    npm WARN While resolving: @material-ui/core@3.9.3
                                    npm WARN Found: react@17.0.2
                                    npm WARN node_modules/react
                                    npm WARN   react@"^17.0.2" from the root project
                                    npm WARN   57 more (@coreui/icons-react, @coreui/react, ...)
                                    npm WARN
                                    npm WARN Could not resolve dependency:
                                    npm WARN peer react@"^16.3.0" from @material-ui/core@3.9.3
                                    npm WARN node_modules/@material-ui/core
                                    npm WARN   peer @material-ui/core@"^3.2.0" from material-ui-pickers@2.2.4
                                    npm WARN   node_modules/material-ui-pickers
                                    npm WARN   1 more (mdbreact)
                                    npm WARN
                                    npm WARN Conflicting peer dependency: react@16.14.0
                                    npm WARN node_modules/react
                                    npm WARN   peer react@"^16.3.0" from @material-ui/core@3.9.3
                                    npm WARN   node_modules/@material-ui/core
                                    npm WARN     peer @material-ui/core@"^3.2.0" from material-ui-pickers@2.2.4
                                    npm WARN     node_modules/material-ui-pickers
                                    npm WARN     1 more (mdbreact)
2022-11-17T22:49:20.218Z [WARNING]: npm WARN
2022-11-17T22:49:20.218Z [WARNING]: ERESOLVE overriding peer dependency
                                    npm WARN While resolving: @material-ui/core@3.9.3
                                    npm WARN Found: react-dom@17.0.2
                                    npm WARN node_modules/react-dom
                                    npm WARN   react-dom@"^17.0.2" from the root project
                                    npm WARN   21 more (@coreui/react, @hookform/error-message, ...)
                                    npm WARN
                                    npm WARN Could not resolve dependency:
                                    npm WARN peer react-dom@"^16.3.0" from @material-ui/core@3.9.3
                                    npm WARN node_modules/@material-ui/core
                                    npm WARN   peer @material-ui/core@"^3.2.0" from material-ui-pickers@2.2.4
                                    npm WARN   node_modules/material-ui-pickers
                                    npm WARN   1 more (mdbreact)
                                    npm WARN
                                    npm WARN Conflicting peer dependency: react-dom@16.14.0
                                    npm WARN node_modules/react-dom
                                    npm WARN   peer react-dom@"^16.3.0" from @material-ui/core@3.9.3
                                    npm WARN   node_modules/@material-ui/core
                                    npm WARN     peer @material-ui/core@"^3.2.0" from material-ui-pickers@2.2.4
                                    npm WARN     node_modules/material-ui-pickers
                                    npm WARN     1 more (mdbreact)
2022-11-17T22:49:20.224Z [WARNING]: npm WARN ERESOLVE overriding peer dependency
2022-11-17T22:49:20.225Z [WARNING]: npm WARN While resolving: @material-ui/system@3.0.0-alpha.2
                                    npm WARN Found: react@17.0.2
                                    npm WARN node_modules/react
                                    npm WARN   react@"^17.0.2" from the root project
                                    npm WARN   57 more (@coreui/icons-react, @coreui/react, ...)
                                    npm WARN
                                    npm WARN Could not resolve dependency:
                                    npm WARN peer react@"^16.3.0" from @material-ui/system@3.0.0-alpha.2
                                    npm WARN node_modules/@material-ui/system
                                    npm WARN   @material-ui/system@"^3.0.0-alpha.0" from @material-ui/core@3.9.3
                                    npm WARN   node_modules/@material-ui/core
                                    npm WARN
                                    npm WARN Conflicting peer dependency: react@16.14.0
                                    npm WARN node_modules/react
                                    npm WARN   peer react@"^16.3.0" from @material-ui/system@3.0.0-alpha.2
                                    npm WARN   node_modules/@material-ui/system
2022-11-17T22:49:20.225Z [WARNING]: npm WARN     @material-ui/system@"^3.0.0-alpha.0" from @material-ui/core@3.9.3
                                    npm WARN     node_modules/@material-ui/core
2022-11-17T22:49:20.229Z [WARNING]: npm WARN ERESOLVE overriding peer dependency
                                    npm WARN While resolving: @material-ui/system@3.0.0-alpha.2
                                    npm WARN Found: react-dom@17.0.2
2022-11-17T22:49:20.229Z [WARNING]: npm WARN node_modules/react-dom
                                    npm WARN   react-dom@"^17.0.2" from the root project
                                    npm WARN   21 more (@coreui/react, @hookform/error-message, ...)
                                    npm WARN
                                    npm WARN Could not resolve dependency:
                                    npm WARN peer react-dom@"^16.3.0" from @material-ui/system@3.0.0-alpha.2
                                    npm WARN node_modules/@material-ui/system
                                    npm WARN   @material-ui/system@"^3.0.0-alpha.0" from @material-ui/core@3.9.3
                                    npm WARN   node_modules/@material-ui/core
                                    npm WARN
                                    npm WARN Conflicting peer dependency: react-dom@16.14.0
                                    npm WARN node_modules/react-dom
                                    npm WARN   peer react-dom@"^16.3.0" from @material-ui/system@3.0.0-alpha.2
                                    npm WARN   node_modules/@material-ui/system
                                    npm WARN     @material-ui/system@"^3.0.0-alpha.0" from @material-ui/core@3.9.3
                                    npm
2022-11-17T22:49:20.229Z [WARNING]: WARN     node_modules/@material-ui/core
2022-11-17T22:49:20.235Z [WARNING]: npm WARN
2022-11-17T22:49:20.235Z [WARNING]: ERESOLVE overriding peer dependency
                                    npm WARN While resolving: @material-ui/utils@3.0.0-alpha.3
                                    npm WARN Found: react@17.0.2
                                    npm WARN node_modules/react
                                    npm WARN   react@"^17.0.2" from the root project
                                    npm WARN   57 more (@coreui/icons-react, @coreui/react, ...)
                                    npm WARN
                                    npm WARN Could not resolve dependency:
                                    npm WARN peer react@"^16.3.0" from @material-ui/utils@3.0.0-alpha.3
                                    npm WARN node_modules/@material-ui/utils
                                    npm WARN   @material-ui/utils@"^3.0.0-alpha.2" from @material-ui/core@3.9.3
                                    npm WARN   node_modules/@material-ui/core
                                    npm
2022-11-17T22:49:20.235Z [WARNING]: WARN
                                    npm WARN Conflicting peer dependency: react@16.14.0
                                    npm WARN node_modules/react
                                    npm WARN   peer react@"^16.3.0" from @material-ui/utils@3.0.0-alpha.3
                                    npm WARN   node_modules/@material-ui/utils
                                    npm WARN     @material-ui/utils@"^3.0.0-alpha.2" from @material-ui/core@3.9.3
                                    npm WARN     node_modules/@material-ui/core
2022-11-17T22:49:20.240Z [WARNING]: npm WARN ERESOLVE
2022-11-17T22:49:20.240Z [WARNING]: overriding peer dependency
                                    npm WARN While resolving: @material-ui/utils@3.0.0-alpha.3
                                    npm WARN Found: react-dom@17.0.2
                                    npm WARN node_modules/react-dom
                                    npm WARN   react-dom@"^17.0.2" from the root project
                                    npm WARN   21 more (@coreui/react, @hookform/error-message, ...)
                                    npm WARN
                                    npm WARN Could not resolve dependency:
                                    npm WARN peer react-dom@"^16.3.0" from @material-ui/utils@3.0.0-alpha.3
                                    npm WARN node_modules/@material-ui/utils
                                    npm WARN   @material-ui/utils@"^3.0.0-alpha.2" from @material-ui/core@3.9.3
                                    npm WARN   node_modules/@material-ui/core
                                    npm WARN
                                    npm WARN Conflicting peer dependency: react-dom@16.14.0
                                    npm WARN node_modules/react-dom
                                    npm WARN   peer react-dom@"^16.3.0" from @material-ui/utils@3.0.0-alpha.3
                                    npm WARN   node_modules/@material-ui/utils
                                    npm WARN     @material-ui/utils@"^3.0.0-alpha.2" from @material-ui/core@3.9.3
                                    npm
2022-11-17T22:49:20.240Z [WARNING]: WARN     node_modules/@material-ui/core
2022-11-17T22:49:28.722Z [WARNING]: npm ERR! code ERESOLVE
2022-11-17T22:49:28.725Z [WARNING]: npm ERR!
2022-11-17T22:49:28.725Z [WARNING]: ERESOLVE could not resolve
                                    npm ERR!
                                    npm ERR! While resolving: aws-appsync@4.0.5
                                    npm ERR! Found: react@17.0.2
                                    npm ERR! node_modules/react
                                    npm ERR!   react@"^17.0.2" from the root project
                                    npm ERR!   peer react@"^17.0.1" from @coreui/icons-react@1.1.0
                                    npm ERR!   node_modules/@coreui/icons-react
                                    npm ERR!     @coreui/icons-react@"^1.1.0" from the root project
                                    npm ERR!   56 more (@coreui/react, @coreui/react-chartjs, @emotion/react, ...)
                                    npm ERR!
2022-11-17T22:49:28.725Z [WARNING]: 
                                    npm ERR! Could not resolve dependency:
                                    npm ERR! peer @react-native-community/async-storage@"^1.11.0" from aws-appsync@4.0.5
                                    npm ERR! node_modules/aws-appsync
                                    npm ERR!   aws-appsync@"^4.0.3" from the root project
                                    npm ERR!   peer aws-appsync@"3.x.x || 4.x.x" from aws-appsync-react@4.0.5
                                    npm ERR!   node_modules/aws-appsync-react
                                    npm ERR!     aws-appsync-react@"^4.0.3" from the root project
                                    npm ERR!
                                    npm ERR! Conflicting peer dependency: react@16.14.0
                                    npm ERR! node_modules/react
                                    npm ERR!   peer react@"^16.8" from @react-native-community/async-storage@1.12.1
                                    npm ERR!   node_modules/@react-native-community/async-storage
                                    npm ERR!     peer @react-native-community/async-storage@"^1.11.0" from aws-appsync@4.0.5
                                    npm ERR!     node_modules/aws-appsync
                                    npm ERR!       aws-appsync@"^4.0.3" from the root project
                                    npm ERR!       1 more (aws-appsync-react)
                                    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 /root/.npm/eresolve-report.txt for a full report.
2022-11-17T22:49:28.726Z [WARNING]: npm
2022-11-17T22:49:28.726Z [WARNING]: ERR! A complete log of this run can be found in:
                                    npm ERR!     /root/.npm/_logs/2022-11-17T22_49_16_301Z-debug-0.log
2022-11-17T22:49:28.737Z [ERROR]: !!! Build failed
2022-11-17T22:49:28.737Z [ERROR]: !!! Non-Zero Exit Code detected
2022-11-17T22:49:28.737Z [INFO]: # Starting environment caching...
2022-11-17T22:49:28.737Z [INFO]: # Uploading environment cache artifact...
2022-11-17T22:49:28.807Z [INFO]: # Uploaded environment cache artifact
2022-11-17T22:49:28.807Z [INFO]: # Environment caching completed
Terminating logging...

'
我试过重新部署以前成功的构建版本,但这确实有帮助。我也试过更改amplify.yaml文件,并在npm ci命令末尾添加--legacy-peer-deps,但这也没有解决问题。我试过手动更新日志中提到的库,但也没有帮助。我真的很感激如何解决这个问题的任何建议。谢谢
我试图在我的Web应用程序中添加一个新功能,我所期待的是一个成功的构建。

a9wyjsp7

a9wyjsp71#

为了成功运行带有--legacy-peer-deps标志的npm ci,您应该添加一个.npmrc文件到您的存储库中,并按如下方式启用遗留的对等依赖项;

# ignore peerDependencies
legacy-peer-deps=true

需要补充的是,要使上述内容按预期工作,同样需要使用package-lock.json

相关问题