Skip to content

npm install get stuck in codebuild

0

I have several code pipelines that install some dependencies like npm i ts-node@^10.0.0. I've got about 10 pipelines that have been running fine for months, but today they all got stuck on the npm i command. I tried it in 2 different accounts and the same thing happened. We rolled back to the last successful deploy to see if it was a bug in our code, but that didn't work either. Also, I created a single codebuild with a one-line buildspect within the command 'npm i ts-node@^10.0.0 and it got stuck. Any idea what could be going on?

asked a year ago1.4K views
3 Answers
0
Accepted Answer

When CodeBuild gets stuck during the npm install step, it could be due to various reasons such as connectivity issues, package registry problems, or resource constraints.

You should review the CodeBuild logs for any clues or error messages, check the AWS Service Health Dashboard for any ongoing issues or service disruptions, ensure the CodeBuild service role has the necessary permissions to access the package registry and download the required packages, try updating the NPM version, clear the NPM cache, increase timeout and resource limits for your CodeBuild project, consider using a specific NPM registry mirror.

EXPERT
answered a year ago
EXPERT
reviewed a year ago
EXPERT
reviewed a year ago
0

It might be a general problem because I work with an AWS organization and have several accounts with different pipelines. Everything was working on Wednesday, July 24, but yesterday they all stopped working. Although there's nothing reported on the AWS Service Health Dashboard, here are some details:

  • All pipelines have a 1-hour timeout, and they usually run in 8 minutes.
  • I opened all ports to rule out network issues, but it still gets stuck.
  • I tried in two different regions, N. Virginia and California, and it's the same in both.
  • The role has always worked; the pipelines have been running for months. I can't think of any permissions needed to execute an npm command.
  • Regarding capacity and memory, all pipelines have 3 GB memory and 2 vCPUs, which should be sufficient. Regarding the cache, since it's npm, what do you mean by cleaning it or managing it?
answered a year ago
0

Reviewing each dependency in my project, I found one that was causing an issue during the download. To identify this error, I ran npm i ts-node@10.9.1 --verbose to see how far the dependency download progressed.

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.