Weird behavior after yarn

I am getting a weird behavior after using yarn. Eny -run step fails after the one using yarn

    parameters:
      environment:
        type: string
    executor:
      name: test-executor
    steps:
      - checkout
      - browser-tools/install-chrome:
          chrome-version: 109.0.5414.74
          replace-existing: true
      - browser-tools/install-chromedriver
      - run:
          name: Check install
          command: |
            google-chrome --version
            chromedriver --version
      - run:
          name: Prepare tests config
          command: |
            set +x
            pwd
            ls
      - run:
          name: Setup npm
          command: |
            npm config set prefix ~/.npm-global
            npm i -g corepack
            export PATH="$HOME/.npm-global/bin:$PATH"
            corepack enable
            yarn set version 3.2.3
      - run:
          name: Prepare tests config
          command: |
            set +x
            pwd
            ls

The last run test fails with:

Exited with code exit status 11
CircleCI received exit code 11
1 Like

error 11 from within a Linux shell normally means an executable has caused a segmentation fault.

The output in the job log may provide more hints about exactly which executable caused the fault, it is not that easy to tell from looking at the config file you have posted.

Not sure what log you are referring to.
There is nothing more this is the entire log screen after another npm command.

#!/bin/bash -eo pipefail
npm i -g corepack

Exited with code exit status 11
CircleCI received exit code 11

I also figure out that this happens on 22.04 machine executor but not on docker.
You can try for yourself to craft a job to verify.