Software⏱️ 3 min read📅 2026-06-11

How to Fix: Dependency Xvfb missing error on npm run

Cypress test error: Dependency Xvfb is missing. Install Xvfb and try again.

Quick Answer: Install Xvfb using apt-get and try running the Cypress test command again.

The error 'Dependency Xvfb missing' occurs when running Cypress tests on Ubuntu WSL-2 Windows 11, indicating that the system is lacking the necessary dependency to run the tests. This issue affects users who have not installed the required dependencies or have an outdated version of the dependency.

This error can be frustrating for developers as it prevents them from successfully running their tests and may lead to wasted time and effort in resolving the issue.

🛑 Root Causes of the Error

  • The primary reason for this error is that Xvfb (X Virtual Frame Buffer) is not installed on the system, which is a dependency required for running Cypress tests. Xvfb provides a virtual framebuffer for running graphical applications without affecting the host system's display.
  • Alternatively, another possible cause could be an outdated version of Xvfb or other dependencies that are not compatible with the current version of Cypress.

🚀 How to Resolve This Issue

Installing Xvfb using apt-get

  1. Step 1: Open a terminal on Ubuntu WSL-2 and run the command `sudo apt-get update` to update the package list.
  2. Step 2: Next, run the command `sudo apt-get install xvfb` to install Xvfb. This may take several minutes to complete.
  3. Step 3: Once the installation is complete, you need to restart the terminal or run `source ~/.bashrc` (or `source ~/.zshrc` if using zsh) to apply the changes.

Installing dependencies manually

  1. Step 1: Extract the dependency list provided in the error message: libgl1-mesa-dri and libqt5svg5.
  2. Step 2: Run `sudo apt-get install libgl1-mesa-dri` to install libgl1-mesa-dri, and then run `sudo apt-get install libqt5svg5` to install libqt5svg5. Be cautious when installing dependencies manually as it may lead to conflicts with other packages.

✨ Wrapping Up

To resolve the 'Dependency Xvfb missing' error on npm run, you can either install Xvfb using apt-get or manually install the required dependencies. By following these steps, you should be able to successfully run your Cypress tests without encountering this error.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions