Skip to content

Bitbucket CI example using node:latest fails #6048

@MikeMcC399

Description

@MikeMcC399

Description

The example Continuous Integration > Bitbucket Pipelines > Basic Setup fails to run.

The example code for bitbucket-pipelines.yml is

image: node:latest

pipelines:
  default:
    - step:
        script:
          # install dependencies
          - npm ci
          # start the server in the background
          - npm run start &
          # run Cypress tests
          - npm run e2e

The error indicates a missing dependency:

Your system is missing the dependency: Xvfb
Install Xvfb and run Cypress again.
Read our documentation on dependencies for more information:
https://on.cypress.io/required-dependencies
If you are using Docker, we provide containers with all required dependencies installed.
----------
Error: spawn Xvfb ENOENT
----------
Platform: linux-x64 (Debian - 12.8)
Cypress Version: 13.16.1

Background

In order to allow Cypress to run using the Docker image node:latest, it needs the set of Linux prerequisites for Debian/Ubuntu installed. Testing against https://github.com/cypress-io/cypress-example-kitchensink, the minimum additional Debian package installation instructions are:

          - apt-get update
          - apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnss3 libasound2 xvfb -y

Adding the step of installing Linux prerequisites for Debian/Ubuntu to node:latest would make the example unnecessarily complex. node:latest is currently equivalent to node:current-bookworm which is in turn based on debian:bookworm.

Cypress Docker images are optimized for Cypress usage. They are based on debian:bookworm-slim rather than debian:bookwork, so they are smaller, and they include all Linux prerequisites for Cypress, replacing the need for an extra installation step.

Suggestion

Remove the Bitbucket Pipelines example using the Docker image node:latest. Add a comment referring to Testing with Cypress Docker Images as the configuration of choice for Bitbucket Pipelines.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions