Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bitbucket Pipeline Timeouts on npm install

Kiril Velichkov March 15, 2024

We have bitbucket project that uses bitbucket pipelines.

Here is what our pipeline looks like


image: node:18.17.0

- step:
name: Unit Tests and Linting
- npm install
- npm run lint
- npm run test:coverage -- --runInBand

Everything was working fine for a year, but since yesterday the pipeline started to timeout on the npm instsall command.
I have tried to re run old pipeline that have passed before, but they still fail, which means the issue is not introduced by a change from us, because we haven't even changed the package.json for a long time.

Any ideas or suggestions what could have caused this issue and how to fix it?

3 answers

1 accepted

0 votes
Answer accepted
Kiril Velichkov March 15, 2024
0 votes
Kiril Velichkov March 15, 2024

Thank you @Eduardo Asenjo 
I will try this and write back later

0 votes
Eduardo Asenjo March 15, 2024

Not a full solution to your problem, but a recommendation.


Recommendation 1:  

Use `npm ci` instead of a full install.  `npm ci` will install directly the definitions from the `package-lock.json` instead of getting latest version of everything from your package.json and recalculating everything. It will be more consistent with your developer and local machines.


Recommendation 2:

When using `npm` I'd recommend to use the `cache: node` bitbucket pipeline notation, so it will cache all packages and save loads of time when running that steps.

Take a look to this: Caches | Bitbucket Cloud | Atlassian Support

This may make your builds slightly faster and potentially prevent this timeout issue.

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events