npx playwright install-deps 在 Debian Buster 上失败

问题描述 投票:0回答:4

当我尝试运行

npx playwright install-deps
时,出现错误。

❯ npx playwright install-deps
Installing Ubuntu dependencies...
Switching to root user to install dependencies...
Hit:1 http://security.debian.org/debian-security bullseye-security InRelease
Hit:2 http://deb.debian.org/debian bullseye InRelease                                
Hit:3 https://updates.signal.org/desktop/apt xenial InRelease                        
Hit:4 https://repo.steampowered.com/steam stable InRelease                           
Hit:5 https://baltocdn.com/helm/stable/debian all InRelease                          
Hit:7 https://packages.microsoft.com/repos/ms-teams stable InRelease                 
Hit:8 http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_Testing  InRelease
Hit:6 https://packagecloud.io/slacktechnologies/slack/debian jessie InRelease        
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'libfontconfig1' instead of 'libfontconfig'
Package libjpeg-turbo8 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Unable to locate package libenchant1c2a
E: Unable to locate package libicu66
E: Package 'libjpeg-turbo8' has no installation candidate

我能够通过添加

--dry-run
标志来找到它尝试安装的软件包,

$ npx playwright install-deps --dry-run
sudo -- sh -c "apt-get update&& apt-get install -y --no-install-recommends fonts-liberation libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libcairo2 libcups2 libdbus-1-3 libdrm2 libegl1 libgbm1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxrandr2 libxshmfence1 xvfb fonts-noto-color-emoji ttf-unifont libfontconfig libfreetype6 xfonts-cyrillic xfonts-scalable fonts-ipafont-gothic fonts-wqy-zenhei fonts-tlwg-loma-otf tt

其中一些软件包未出现在上面的列表中。

debian playwright debian-buster
4个回答
5
投票

Playwright 仅正式支持 Ubuntu linux 发行版 20/22 + Debian 11 请参阅此处:https://playwright.dev/docs/library#linux


1
投票

0
投票

对于 pnpm 人员,您可以使用

pnpm exec playwright install


0
投票

@evan-carroll,我在 Debian 11 (Windows 11 WSL) 上运行项目时遇到了同样的问题。您运行 pnpm dlx playwright install-deps 的想法解决了该问题。

© www.soinside.com 2019 - 2024. All rights reserved.