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

Yarn install fails

Balakrishnan S December 11, 2020

Yarn install fails on random package but always shows same kind of error "Extracting tar content of undefined failed, the file appears to be corrupt: "ENOENT: no such file or directory, "

Extracting tar content of undefined failed, the file appears to be corrupt: "ENOENT: no such file or directory, chmod '/usr/local/share/.cache/yarn/v6/npm-@babel-core-7.12.10-b79a2e1b9f70ed3d84bbfb6d8c4ef825f606bccd-integrity/node_modules/@babel/core/lib/transform-ast.js'"

It seems to working in any machine except the bitbucket pipeline I have issues with.

4 answers

0 votes
Douglas Nassif Roma Junior
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 16, 2022

@Theodora Boudale  For us, this happens intermittently every day.

"yarn install --network-concurrency 1" helps, but doesn't solve it.

Sometimes it only resolves after clearing the pipeline cache.

Config:

 

image: node:16

definitions:

  caches:
    yarn: /usr/local/share/.cache/yarn
    nodemodules: $BITBUCKET_CLONE_DIR/node_modules
    jest: $BITBUCKET_CLONE_DIR/jest_cache

  steps:
    - step: &test-step
        name: Test
        caches:
          - nodemodules
          - jest
          - yarn
        script:
          - yarn install --network-timeout 60000 --network-concurrency 1
          - yarn test:ci

    - step: &lint-step
        name: Code linting
        caches:
          - nodemodules
          - yarn
        script:
          - yarn install --network-timeout 60000 --network-concurrency 1
          - yarn lint:tsc:ci

pipelines:
  branches:
    "{dev,hmg,master}":
      - step: *lint-step
      - step: *test-step

  pull-requests:
    "**":
      - step: *lint-step
      - step: *test-step
Screen Shot 2022-12-16 at 15.54.05.png
0 votes
Liam Parker
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 30, 2022

We're seeing this issue as well. Always via bitbucket pipeline only with the following command.

- yarn install
To solve we must use the following

- yarn install --network-concurrency 1
The image we use on our pipeline is 
image: node:16
Liam Parker
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 30, 2022

We only began encountering this when using yarn. The issue never occurred with npm

0 votes
Brian Bolton
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 7, 2021

I see this issue consistently on bitbucket pipelines and never on the local with same code.

Workaround is to set network concurrency to 1 for yarn, which is not ideal as it drastically slows the install process: `yarn install --network-concurrency 1`

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 14, 2020

Hi @Balakrishnan S ,

Does the issue occur on every build or is it random failures?

Are you able to reproduce this error if you debug the build locally with Docker, as per the following documentation?

I would suggest debugging this locally as per the instructions above, by taking a clone of the repo, reset to a commit where you had a failed build with this error, and then test it with a Docker container that uses the same image as your Pipelines build.

If the same issue occurs when you debug this locally with Docker, this would indicate that the issue is most likely related to either the Docker image used for the build, the configuration or a dependency.

Please feel free to let me know how it goes.

Kind regards,
Theodora

Balakrishnan S August 29, 2021

It happens for me all the time and I have moved to npm

Deleted user June 3, 2022

I can confirm that this happens every time when I push to bitbucket but not when I run locally in a docker container

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events