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日前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ