Amplify NextJs Frontend Build Failing

0

Trying to build a NextJs App using Node v10.19.0 and NextJs 10.0.7. The application compiled successfully but right after the message "Staring SSR Build...". In my build settings, I have specified pre-build commands to use nvm install 10.19.0 as well as update the build image settings to use Next.js version 10. Does anyone know why this is happening? Why would it require node >= 12?

{ Error: Command failed: npm install @sls-next/-component@3.7.0 --prefix /root/./ npm WARN EBADENGINE Unsupported engine { package: '@aws-sdk/client-s3@3.54.0', npm WARN EBADENGINE required: { node: '>=12.0.0' }, npm WARN EBADENGINE current: { node: 'v10.19.0', npm: '7.24.2' } } npm WARN EBADENGINE Unsupported engine { package: '@aws-sdk/client-sqs@3.54.0', npm WARN EBADENGINE required: { node: '>=12.0.0' }, npm WARN EBADENGINE current: { node: 'v10.19.0', npm: '7.24.2' } }...

已提問 2 年前檢視次數 1754 次
1 個回答
0
已接受的答案

Hello,

I have researched on this issue and successfully able to reproduce and solve the issue in my test envrionment, kindly allow me share my findings with you,

a) Does anyone know why this is happening? 2. Why would it require node >= 12?

Since, the Node js version 10.19.0 is released on (2020-02-05), and @aws-sdk/client-<package>-3.54.0 are released 6 month back, due to this reason latest aws-sdk packages might not compaitible with 2 year old version of Node js 10.19.0.

b) How to resolve this issue ?

To resolve this issue please follow below navigation to modify your build setting and set the Nodejs and Nextjs version for you Amplify application deployment.

  • Amplify --> Select your Amplify App --> Go to the Build settings --> Go to Build image settings

Node.js version: 12

Next.js version: 10.0.7

Thanks

AWS
已回答 2 年前
profile picture
專家
已審閱 24 天前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南