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' } }...

feita há 2 anos1754 visualizações
1 Resposta
0
Resposta aceita

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
respondido há 2 anos
profile picture
ESPECIALISTA
avaliado há 24 dias

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas