7

I am linked my AWS Amplify app to a new React Gatsby GitHub repo for continuous deployment. The app compiles fine locally, but I am getting an error in the 'Frontend' during the AWS build, saying that the amplify.sh file is 'killed' at the npm run build line, followed by 'Non-Zero Exit Code Detected' error. Below is a link to a screenshot of the error:

AWS Amplify Error

Below are the contents of my amplify.yml file in AWS:

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - npm ci
    build:
      commands:
        - npm run build
  artifacts:
    baseDirectory: public
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*

Do I need to edit the amplify.yml file, or maybe add something to a package-lock or gatsby-node file?

2 Answers 2

2

I was able to solve this by running npm install (locally) and push to the branch. The error was invalid package-lock file version.

This was the step suggested in the build fail log.

Sign up to request clarification or add additional context in comments.

Comments

0

Your script looks fine.

Would you be able to confirm that the IAM Role 'AWSAmplifyExecutionRole' has the AdministratorAccess permission? In order to do a CloudFormation deploy the role needs that permission in order to create all the resources in the stack.

OR

Please share the error log content, if possible.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.