1

I have an AWS S3 bucket to host an angular app. The S3 bucket works fine with AWS CLI. But the build app job in CircleCI fails!

NOTE: I can build the app locally and then deploy it to the s3 bucket successfully.

S3 has public access, the bucket policy for public read access, and has been enabled to host an index.html.

Failed job in CircleCI to build the angular app:

build job cicleci

CircleCI configuration file (config.yml):

config.yml

The npm run frontend:build command runs ng build to create the www folder and then deploys the app.

This is what I got at the end of the big output file in CircleCI:

log file

Top-Master
  • 7,611
  • 5
  • 39
  • 71
someone
  • 21
  • 3

2 Answers2

1

Your CircleCI instance seems to be out of:

  • RAM
  • Or even Storage

Simply increase both temporarily, by 1 or 2 GB each, to see if that fixes the issue.


Normally there should be no caching in CI, but if your's has, also try to clear cache with commands mentioned at:

https://stackoverflow.com/a/49505612/8740349

Also, above link suggests re-creating package-lock.json, but as your local works, ensure CI uses same package-lock.json file (maybe by tracking it in Git).

Top-Master
  • 7,611
  • 5
  • 39
  • 71
  • so you mean I should add new run ```npm cache clean --force``` before run of ```npm run frontend:install``` in the circleci config.yml ? – someone Mar 04 '23 at 16:02
  • @someone Before `npm install`, also, that's just one of the link's commands. Try all, is CI, your files don't get really deleted. – Top-Master Mar 04 '23 at 18:11
  • @someone consider accepting if this was helpful (there should be tick-mark button somewhere above). – Top-Master Mar 04 '23 at 21:03
0

I recognize that I put package-lock.json in .gitignore so I remove it then I add npm cache clean --force before npm install of the frontend and it works fine. Thanks a lot for @Top-Master

someone
  • 21
  • 3