Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting phase: preBuild build failure #3743

Closed
4 tasks done
Sardor-M opened this issue Oct 4, 2023 · 5 comments
Closed
4 tasks done

Starting phase: preBuild build failure #3743

Sardor-M opened this issue Oct 4, 2023 · 5 comments
Assignees
Labels
archived This issue has been locked. frontend-builds question Further information is requested

Comments

@Sardor-M
Copy link

Sardor-M commented Oct 4, 2023

Before opening, please confirm:

App Id

d2yhdze04u5fsp

AWS Region

us-east-1

Amplify Hosting feature

Frontend builds

Question

Before having this issue, i had a package version conflicts and i fixed them successfully. But after that point, the frontend build is throwing this error.

Question:

  • How can it get this package_locjk.json and package.json syncronization issue get resolved and be able to build my project successfully on AWS Amplify ?

What i have tried to solve it?
i followed the this solution and Issue-3289to solve the issue.

First try - solution case:

  • i removed the package-lock.json file and the node_modulesfolder, and regenerated using npm install. This did not work though.

Second try - solution case:

  • i did sync package-lock.json with package.json using a npm cicommand as it was showing in the error message. However this try also did not work out.

Below this is the error message log:
Starting phase: preBuild
2023-10-04T16:13:32.693Z [INFO]: # Executing command: npm ci
2023-10-04T16:13:40.825Z [WARNING]: npm
2023-10-04T16:13:40.827Z [WARNING]: ERR! code EUSAGE
2023-10-04T16:13:40.872Z [WARNING]: npm ERR!
2023-10-04T16:13:40.873Z [WARNING]:
npm ERR! npm ci can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with npm install before continuing.
npm ERR!
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: @jest/[email protected] from lock file
npm ERR! Missing: @react-native-community/[email protected] from lock file
npm ERR! Missing: @react-native-community/[email protected] from lock file
npm ERR! Missing: @react-native-community/[email protected] from lock file
npm ERR! Missing: @react-native/[email protected] from lock file
npm ERR! Missing: @react-native/[email protected] from lock file
npm ERR! Missing: @react-native/[email protected] from lock file
npm ERR! Missing: @react-native/[email protected] from lock file
npm ERR! Missing: @react-native/[email protected] from lock file
npm ERR! Missing: @react-native/[email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
2023-10-04T16:13:40.873Z [WARNING]: npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: @jest/[email protected] from lock file
npm ERR! Missing: @jest/[email protected] from lock file
npm ERR! Missing: @types/[email protected] from lock file
npm ERR! Missing: @types/[email protected] from lock file
npm ERR! Missing: @types/[email protected] from lock file
npm ERR! Missing: @sinclair/[email protected] from lock file
npm ERR! Missing: @react-native-community/[email protected] from lock file
npm ERR!
2023-10-04T16:13:40.873Z [WARNING]: Missing: @react-native-community/[email protected] from lock file
npm ERR! Missing: @react-native-community/[email protected] from lock file
npm ERR! Missing: @react-native-community/[email protected] from lock file
npm ERR! Missing: @react-native-community/[email protected] from lock file
npm ERR! Missing: @react-native-community/[email protected] from lock file
npm ERR! Missing: @react-native-community/[email protected] from lock file
npm ERR! Missing: @react-native-community/[email protected] from lock file
npm ERR! Missing: @react-native-community/[email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm
2023-10-04T16:13:40.873Z [WARNING]: ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
2023-10-04T16:13:40.873Z [WARNING]: npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
2023-10-04T16:13:40.874Z [WARNING]: npm ERR! Missing: @types/[email protected] from lock file
npm ERR! Missing: @types/[email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR!
2023-10-04T16:13:40.874Z [WARNING]: Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm
2023-10-04T16:13:40.874Z [WARNING]: ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: @jest/[email protected] from lock file
npm ERR! Missing: @jest/[email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: @sinonjs/[email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: @sinonjs/[email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: @types/[email protected] from lock file
npm
2023-10-04T16:13:40.874Z [WARNING]: ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: @hapi/[email protected] from lock file
npm ERR! Missing: @hapi/[email protected] from lock file
npm ERR! Missing: @sideway/[email protected] from lock file
npm ERR! Missing: @sideway/[email protected] from lock file
npm ERR! Missing: @sideway/[email protected] from lock file
npm ERR! Missing: @babel/[email protected] from lock file
npm ERR! Missing: @babel/[email protected] from lock file
npm ERR! Missing: @babel/[email protected] from lock file
npm ERR! Missing: @babel/[email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR!
2023-10-04T16:13:40.874Z [WARNING]: Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: @babel/[email protected] from lock file
npm ERR! Missing: @babel/[email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm
2023-10-04T16:13:40.874Z [WARNING]: ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
2023-10-04T16:13:40.875Z [WARNING]: npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm
2023-10-04T16:13:40.875Z [WARNING]: ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: @babel/[email protected] from lock file
npm ERR! Missing: @babel/[email protected] from lock file
npm ERR! Missing: @babel/[email protected] from lock file
npm ERR! Missing: @babel/[email protected] from lock file
npm ERR! Missing: @babel/[email protected] from lock file
npm ERR! Missing: @babel/[email protected] from lock file
npm ERR! Missing: @babel/[email protected] from lock file
npm ERR! Missing: @babel/[email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm
2023-10-04T16:13:40.876Z [WARNING]: ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: @jest/[email protected] from lock file
2023-10-04T16:13:40.876Z [WARNING]: npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR!
2023-10-04T16:13:40.876Z [WARNING]: Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR!
2023-10-04T16:13:40.876Z [WARNING]: Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR!
2023-10-04T16:13:40.876Z [WARNING]: Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
2023-10-04T16:13:40.876Z [WARNING]: npm ERR! Missing: @jridgewell/[email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR!
2023-10-04T16:13:40.877Z [WARNING]: Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR!
2023-10-04T16:13:40.877Z [WARNING]: Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR!
2023-10-04T16:13:40.877Z [WARNING]: Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
2023-10-04T16:13:40.877Z [WARNING]: npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm
2023-10-04T16:13:40.878Z [WARNING]: ERR! Missing: [email protected] from lock file
npm ERR! Missing: @jest/[email protected] from lock file
npm ERR! Missing: @types/[email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: @types/[email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR!
npm ERR! Clean install a project
npm ERR!
npm ERR! Usage:
npm ERR! npm ci
npm ERR!
npm ERR! Options:
npm ERR! [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
npm ERR! [-E|--save-exact] [-g|--global] [--global-style] [--legacy-bundling]
npm ERR! [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
npm ERR! [--strict-peer-deps] [--no-package-lock] [--foreground-scripts]
npm ERR! [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
npm ERR! [-w|--workspace [-w|--workspace ...]]
npm ERR! [-ws|--workspaces] [--include-workspace-root] [--install-links]
npm ERR!
npm ERR! aliases: clean-install, ic, install-clean, isntall-clean
npm ERR!
npm ERR! Run "npm help ci" for more info
2023-10-04T16:13:40.880Z [WARNING]:
2023-10-04T16:13:40.882Z [WARNING]: npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2023-10-04T16_13_32_921Z-debug-0.log
2023-10-04T16:13:40.892Z [ERROR]: !!! Build failed
2023-10-04T16:13:40.892Z [INFO]: Please check the supported SSR features to find if your build failure is related to an unsupported feature: https://docs.aws.amazon.com/amplify/latest/userguide/ssr-Amplify-support.html#supported-unsupported-features. You may also find this troubleshooting guide useful: https://docs.aws.amazon.com/amplify/latest/userguide/troubleshooting-ssr-deployment.html
2023-10-04T16:13:40.892Z [ERROR]: !!! Non-Zero Exit Code detected
2023-10-04T16:13:40.892Z [INFO]: # Starting environment caching...
2023-10-04T16:13:40.893Z [INFO]: # Environment caching completed
Terminating logging...

@Sardor-M Sardor-M added the question Further information is requested label Oct 4, 2023
@Sardor-M Sardor-M changed the title Frontend - Starting phase: preBuild build failure Starting phase: preBuild build failure Oct 4, 2023
@Jay2113 Jay2113 self-assigned this Oct 10, 2023
@Jay2113
Copy link
Contributor

Jay2113 commented Oct 10, 2023

Hi @Sardor-M 👋 , thanks for raising this!

Our recommendation for build failures such as these is to perform a clean install as follows:

  • Delete the package-lock.json and node_modules folder locally
  • Run npm install
  • Remove the cache path from the build specification file amplify.yml in the Amplify Console as it is used to cache build-time dependencies such as the node_modules folder
  • Commit and push the changes to the git repository and a new build will initiate with synced package.json and package-lock.json files.

You may also want to try the steps mentioned here: https://stackoverflow.com/a/76004061

@Jay2113 Jay2113 added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Oct 10, 2023
@Sardor-M
Copy link
Author

Hi @Jay2113, thanks for reaching out !

After following your instructions and the solution reference you provided, I successfully build and deployed my project to the AWS Amplify.

This link stackoveflow issue helped me a lot to resolve the issue.

Once again, thanks for helping me out to solve this issue.

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

@Sardor-M Sardor-M reopened this Oct 11, 2023
@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Oct 11, 2023
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

@github-actions
Copy link

This issue has been automatically locked.

@github-actions github-actions bot added the archived This issue has been locked. label Oct 17, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived This issue has been locked. frontend-builds question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants