microsoft / microsoft/playwright

[BUG] Host system is missing dependencies to run browsers (WSL2)

Open
#19,100 15 comments 21 reactions 0 assignees View on GitHub
P3-collecting-feedback
Dominant language
TypeScript
Stars
96.3k
Forks
6.5k
Avg merge
1d 6h
Merged PRs (30d)
180

Description

**Context:**
- Playwright Version:1.28.1
- Operating System: Ubuntu 20.04.5 LTS (WSL 2)
- Node.js version: v18.4.0
- Browser:All

## System:
- OS: Linux 5.10 Ubuntu 20.04.5 LTS (Focal Fossa)
- Memory: 12.41 GB / 15.58 GB
- Container: Yes
## Binaries:
- Node: 18.4.0 - ~/.nvm/versions/node/v18.4.0/bin/node
- Yarn: 1.22.19 - ~/.nvm/versions/node/v18.4.0/bin/yarn
- npm: 8.12.1 - ~/.nvm/versions/node/v18.4.0/bin/npm
## Languages:
- Bash: 5.0.17 - /usr/bin/bash
## npmPackages:
- playwright: 1.28.1 => 1.28.1

**Code Snippet**

Help us help you! Put down a short code snippet that illustrates your bug and
that we can run and debug locally. For example:

```javascript
import { chromium } from "playwright";

async function main() {
const browser = await chromium.launch();
}

main();
```

**Describe the bug**

While running the code above, I'm getting

```
╔══════════════════════════════════════════════════════╗
║ Host system is missing dependencies to run browsers. ║
║ Please install them with the following command: ║
║ ║
║ sudo npx playwright install-deps ║
║ ║
║ Alternatively, use apt: ║
║ sudo apt-get install libglib2.0-0\ ║
║ libnss3\ ║
║ libnspr4\ ║
║ libatk1.0-0\ ║
║ libatk-bridge2.0-0\ ║
║ libcups2\ ║
║ libdrm2\ ║
║ libdbus-1-3\ ║
║ libatspi2.0-0\ ║
║ libxcomposite1\ ║
║ libxdamage1\ ║
║ libxfixes3\ ║
║ libxrandr2\ ║
║ libgbm1\ ║
║ libxkbcommon0\ ║
║ libpango-1.0-0\ ║
║ libcairo2\ ║
║ libasound2 ║
║ ║
║ <3 Playwright Team ║
╚══════════════════════════════════════════════════════╝
```

Trying to follow the instructions leads to the same error:

```
➜ xxx ✗ pnpm tsx src/index.ts
browserType.launch:
╔══════════════════════════════════════════════════════╗
║ Host system is missing dependencies to run browsers. ║
║ Please install them with the following command: ║
║ ║
║ sudo npx playwright install-deps ║
║ ║
║ Alternatively, use apt: ║
║ sudo apt-get install libglib2.0-0\ ║
║ libnss3\ ║
║ libnspr4\ ║
║ libatk1.0-0\ ║
║ libatk-bridge2.0-0\ ║
║ libcups2\ ║
║ libdrm2\ ║
║ libdbus-1-3\ ║
║ libatspi2.0-0\ ║
║ libxcomposite1\ ║
║ libxdamage1\ ║
║ libxfixes3\ ║
║ libxrandr2\ ║
║ libgbm1\ ║
║ libxkbcommon0\ ║
║ libpango-1.0-0\ ║
║ libcairo2\ ║
║ libasound2 ║
║ ║
║ <3 Playwright Team ║
╚══════════════════════════════════════════════════════╝
at main (/.../src/index.ts:167:34)
at queue (/.../src/index.ts:269:1)
at Object. (/.../src/index.ts:269:6)
at Object.T (/home/eliya/projects/home-app/node_modules/.pnpm/@esbuild-kit+cjs-loader@2.4.1/node_modules/@esbuild-kit/cjs-loader/dist/index.js:1:901) {
name: 'Error'
}

Node.js v18.4.0
➜ xxx ✗ sudo npx playwright install-deps
sudo: npx: command not found
➜ xxx ✗ npx playwright install-deps
Installing dependencies...
Switching to root user to install dependencies...
Hit:1 https://download.docker.com/linux/ubuntu focal InRelease
Hit:2 https://apt.releases.hashicorp.com focal InRelease
Hit:3 https://cli.github.com/packages focal InRelease
Get:4 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:5 https://cli.github.com/packages stable InRelease
Hit:6 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:7 http://ppa.launchpad.net/redislabs/redis/ubuntu focal InRelease
Hit:8 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:9 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease
Hit:10 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:11 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Fetched 114 kB in 1s (131 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libfontconfig1' instead of 'libfontconfig'
fonts-liberation is already the newest version (1:1.07.4-11).
libatk1.0-0 is already the newest version (2.35.1-1ubuntu2).
libatspi2.0-0 is already the newest version (2.36.0-2).
libcairo-gobject2 is already the newest version (1.16.0-4ubuntu1).
libcairo2 is already the newest version (1.16.0-4ubuntu1).
libdbus-glib-1-2 is already the newest version (0.110-5fakssync1).
libepoxy0 is already the newest version (1.5.4-1).
libevent-2.1-7 is already the newest version (2.1.11-stable-1).
libfontconfig1 is already the newest version (2.13.1-2ubuntu3).
libhyphen0 is already the newest version (2.8.8-7).
libnspr4 is already the newest version (2:4.25-1).
libopus0 is already the newest version (1.3.1-0ubuntu1).
libpango-1.0-0 is already the newest version (1.44.7-2ubuntu4).
libpangocairo-1.0-0 is already the newest version (1.44.7-2ubuntu4).
libpangoft2-1.0-0 is already the newest version (1.44.7-2ubuntu4).
libpng16-16 is already the newest version (1.6.37-2).
libsoup2.4-1 is already the newest version (2.70.0-1).
libvpx6 is already the newest version (1.8.2-1build1).
libwoff1 is already the newest version (1.0.2-1build2).
libxcb-shm0 is already the newest version (1.14-2).
libxcb1 is already the newest version (1.14-2).
libxcomposite1 is already the newest version (1:0.4.5-1).
libxcursor1 is already the newest version (1:1.2.0-2).
libxdamage1 is already the newest version (1:1.1.5-2).
libxext6 is already the newest version (2:1.3.4-0ubuntu1).
libxfixes3 is already the newest version (1:5.0.3-2).
libxi6 is already the newest version (2:1.7.10-0ubuntu1).
libxkbcommon0 is already the newest version (0.10.0-1).
libxrandr2 is already the newest version (2:1.5.2-0ubuntu1).
libxrender1 is already the newest version (1:0.9.10-1).
libxshmfence1 is already the newest version (1.3-1).
libxt6 is already the newest version (1:1.1.5-1).
libxtst6 is already the newest version (2:1.2.3-1).
ttf-unifont is already the newest version (1:12.0.01-2).
xfonts-scalable is already the newest version (1:1.0.3-1.1).
fonts-ipafont-gothic is already the newest version (00303-18ubuntu1).
fonts-tlwg-loma-otf is already the newest version (1:0.7.1-3).
fonts-wqy-zenhei is already the newest version (0.9.45-7ubuntu1).
gstreamer1.0-libav is already the newest version (1.16.2-2).
libenchant1c2a is already the newest version (1.6.0-11.3build1).
ttf-ubuntu-font-family is already the newest version (1:0.83-4ubuntu1).
xfonts-cyrillic is already the newest version (1:1.0.4).
fonts-noto-color-emoji is already the newest version (0~20200916-1~ubuntu20.04.1).
gstreamer1.0-plugins-base is already the newest version (1.16.3-0ubuntu1.1).
gstreamer1.0-plugins-good is already the newest version (1.16.3-0ubuntu1.1).
libasound2 is already the newest version (1.2.2-2.1ubuntu2.5).
libatk-bridge2.0-0 is already the newest version (2.34.2-0ubuntu2~20.04.1).
libatomic1 is already the newest version (10.3.0-1ubuntu1~20.04).
libcups2 is already the newest version (2.3.1-9ubuntu1.2).
libdbus-1-3 is already the newest version (1.12.16-2ubuntu2.3).
libdrm2 is already the newest version (2.4.107-8ubuntu1~20.04.2).
libegl1 is already the newest version (1.3.2-1~ubuntu0.20.04.2).
libenchant-2-2 is already the newest version (2.2.8-1ubuntu0.20.04.1).
libevdev2 is already the newest version (1.9.0+dfsg-1ubuntu0.2).
libfreetype6 is already the newest version (2.10.1-2ubuntu0.2).
libgbm1 is already the newest version (21.2.6-0ubuntu0.1~20.04.2).
libgdk-pixbuf2.0-0 is already the newest version (2.40.0+dfsg-3ubuntu0.4).
libgl1 is already the newest version (1.3.2-1~ubuntu0.20.04.2).
libgles2 is already the newest version (1.3.2-1~ubuntu0.20.04.2).
libglib2.0-0 is already the newest version (2.64.6-1~ubuntu20.04.4).
libgstreamer-gl1.0-0 is already the newest version (1.16.3-0ubuntu1.1).
libgstreamer1.0-0 is already the newest version (1.16.3-0ubuntu1.1).
libgtk-3-0 is already the newest version (3.24.20-0ubuntu1.1).
libharfbuzz-icu0 is already the newest version (2.6.4-1ubuntu4.2).
libharfbuzz0b is already the newest version (2.6.4-1ubuntu4.2).
libicu66 is already the newest version (66.1-2ubuntu2.1).
libjpeg-turbo8 is already the newest version (2.0.3-0ubuntu1.20.04.3).
libnotify4 is already the newest version (0.7.9-1ubuntu3.20.04.2).
libnss3 is already the newest version (2:3.49.1-1ubuntu1.8).
libopengl0 is already the newest version (1.3.2-1~ubuntu0.20.04.2).
libopenjp2-7 is already the newest version (2.3.1-1ubuntu4.20.04.1).
libsecret-1-0 is already the newest version (0.20.4-0ubuntu1).
libwayland-client0 is already the newest version (1.18.0-1ubuntu0.1).
libwayland-egl1 is already the newest version (1.18.0-1ubuntu0.1).
libwayland-server0 is already the newest version (1.18.0-1ubuntu0.1).
libwebp6 is already the newest version (0.6.1-2ubuntu0.20.04.1).
libwebpdemux2 is already the newest version (0.6.1-2ubuntu0.20.04.1).
libx11-6 is already the newest version (2:1.6.9-2ubuntu1.2).
libx11-xcb1 is already the newest version (2:1.6.9-2ubuntu1.2).
libxml2 is already the newest version (2.9.10+dfsg-5ubuntu0.20.04.4).
libxslt1.1 is already the newest version (1.1.34-4ubuntu0.20.04.1).
ffmpeg is already the newest version (7:4.2.7-0ubuntu0.1).
gstreamer1.0-plugins-bad is already the newest version (1.16.3-0ubuntu1).
xvfb is already the newest version (2:1.20.13-1ubuntu1~20.04.4).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
➜ xxx ✗ sudo apt-get install libglib2.0-0 libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libdbus-1-3 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libpango-1.0-0 libcairo2 libasound2 libatspi2.0-0 libwayland-client0
Reading package lists... Done
Building dependency tree
Reading state information... Done
libatk1.0-0 is already the newest version (2.35.1-1ubuntu2).
libatspi2.0-0 is already the newest version (2.36.0-2).
libcairo2 is already the newest version (1.16.0-4ubuntu1).
libnspr4 is already the newest version (2:4.25-1).
libpango-1.0-0 is already the newest version (1.44.7-2ubuntu4).
libxcomposite1 is already the newest version (1:0.4.5-1).
libxdamage1 is already the newest version (1:1.1.5-2).
libxfixes3 is already the newest version (1:5.0.3-2).
libxkbcommon0 is already the newest version (0.10.0-1).
libxrandr2 is already the newest version (2:1.5.2-0ubuntu1).
libasound2 is already the newest version (1.2.2-2.1ubuntu2.5).
libatk-bridge2.0-0 is already the newest version (2.34.2-0ubuntu2~20.04.1).
libcups2 is already the newest version (2.3.1-9ubuntu1.2).
libdbus-1-3 is already the newest version (1.12.16-2ubuntu2.3).
libdrm2 is already the newest version (2.4.107-8ubuntu1~20.04.2).
libgbm1 is already the newest version (21.2.6-0ubuntu0.1~20.04.2).
libglib2.0-0 is already the newest version (2.64.6-1~ubuntu20.04.4).
libnss3 is already the newest version (2:3.49.1-1ubuntu1.8).
libwayland-client0 is already the newest version (1.18.0-1ubuntu0.1).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
➜ xxx ✗ pnpm tsx src/index.ts
browserType.launch:
╔══════════════════════════════════════════════════════╗
║ Host system is missing dependencies to run browsers. ║
║ Please install them with the following command: ║
║ ║
║ sudo npx playwright install-deps ║
║ ║
║ Alternatively, use apt: ║
║ sudo apt-get install libglib2.0-0\ ║
║ libnss3\ ║
║ libnspr4\ ║
║ libatk1.0-0\ ║
║ libatk-bridge2.0-0\ ║
║ libcups2\ ║
║ libdrm2\ ║
║ libdbus-1-3\ ║
║ libatspi2.0-0\ ║
║ libxcomposite1\ ║
║ libxdamage1\ ║
║ libxfixes3\ ║
║ libxrandr2\ ║
║ libgbm1\ ║
║ libxkbcommon0\ ║
║ libpango-1.0-0\ ║
║ libcairo2\ ║
║ libasound2 ║
║ ║
║ <3 Playwright Team ║
╚══════════════════════════════════════════════════════╝
at main (/.../src/index.ts:167:34)
at queue (/.../src/index.ts:269:1)
at Object. (/.../src/index.ts:269:6)
at Object.T (...) {
name: 'Error'
}

Node.js v18.4.0
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure from src/index.ts:167:34 on Ubuntu 20.04 under WSL2, starting with the documented `npx playwright install-deps` command and the listed apt packages. Compare the dependency-install result with the subsequent browser launch; done means the reported setup can install dependencies and launch a browser without the missing-dependencies error.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, node.js, typescript, ubuntu
Domain
operating-systems, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.