[BUG] npm init playwright fails
See original GitHub issueHi! I am new here. Trying to get started with Playwright in one of my projects.
Context:
- Playwright Version: 1.21.0
- Operating System: Ubuntu 20.04.4 LTS running under WSL2, Windows 10 Pro, 21H2, 19044.1586
- Node.js version: v16.13.1
- Browser: All
- Extra:
Code Snippet
npm init playwright
Describe the bug
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libegl-mesa0 : Depends: libgbm1 (= 21.2.6-0ubuntu0.1~20.04.1) but 21.2.6-0ubuntu0.1~20.04.2 is to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
Failed to install browsers
Error: Installation process exited with code: 100
Error: Command failed: npx playwright install --with-deps
at checkExecSyncError (node:child_process:826:11)
at execSync (node:child_process:900:15)
at executeCommands (/home/einar/.npm/_npx/d40a10098bccdd29/node_modules/create-playwright/lib/index.js:4519:39)
at Generator.run (/home/einar/.npm/_npx/d40a10098bccdd29/node_modules/create-playwright/lib/index.js:4593:5)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /home/einar/.npm/_npx/d40a10098bccdd29/node_modules/create-playwright/lib/index.js:4770:3 {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 9825,
stdout: null,
stderr: null
}
npm ERR! code 1
Where to go from here? Am I doing something wrong? Is this a common error? If so, please add to docs / getting started…
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Installing playwright using npm gives error `command failed`
I tried to install playwright using the command npm i playwright. But got an error npm ERR! code 1 npm ERR! path ...
Read more >playwright - npm
Run from your project's root directory npm init playwright@latest # Or ... Capture all the information to investigate the test failure.
Read more >Cannot find module '@playwright/test' error in Node.js
The error "Cannot find name '@playwright/test'" occurs when we import the @playwright/test module before installing it. To solve the error, ...
Read more >How to Install Playwright - YouTube
The steps for installing Playwright are the same no matter which operating system you use. Ensure you have Node JS, and Visual Studio...
Read more >How To Run End-to-End Tests Using Playwright and Docker
You need a sudo-enabled account to install NodeJS and Docker on your ... navigation and compiler error warning when working in Typescript.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Alright. I cleaned my apt cache, ran
apt update
andapt upgrade
. Then I rannpm init playwright@latest
and after thatsudo npx playwright install-deps
.Now it works! 🎉
Detail: running
npx playwright show-report
does not work out of the box, but if I change the url to localhost it does. Probably something wsl2-related but nvm.Closing. Thanks for your response(s)
For me it’s working in this setup:
Windows 11 WSL2 - Ubuntu 20.04.4 LTS Node v16.13.1