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

posta 2 anni fa1754 visualizzazioni
1 Risposta
0
Risposta accettata

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
con risposta 2 anni fa
profile picture
ESPERTO
verificato 24 giorni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande