WSL - Doesn't appear to Install Chromium
See original GitHub issueUsing ~WSL~ WSL 2 on Windows 10 does not appear to install any browser when I yarn install. I have not tested it on WSL 1.
Running your reference examples results in:
$yarn install
yarn install v1.21.1
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.07s.
() /.../playwright $node main.js
(node:1704) UnhandledPromiseRejectionWarning: Error: Chromium revision is not downloaded. Run "npm install" or "yarn install"
at CRPlaywright.launchServer (/home/-/playwright/node_modules/playwright-core/lib/server/crPlaywright.js:87:23)
at async CRPlaywright.launch (/home/-/playwright/node_modules/playwright-core/lib/server/crPlaywright.js:64:24)
at async /home/-/playwright/main.js:4:21
-- ASYNC --
at CRPlaywright.<anonymous> (/home/-/playwright/node_modules/playwright-core/lib/helper.js:54:23)
at CRPlaywright.launch (/home/-/playwright/node_modules/playwright-core/lib/server/crPlaywright.js:64:35)
at CRPlaywright.<anonymous> (/home/-/playwright/node_modules/playwright-core/lib/helper.js:55:31)
at /home/-/playwright/main.js:4:38
at Object.<anonymous> (/home/-/playwright/main.js:9:3)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
-- ASYNC --
at CRPlaywright.<anonymous> (/home/-/playwright/node_modules/playwright-core/lib/helper.js:54:23)
at /home/-/playwright/main.js:4:38
at Object.<anonymous> (/home/-/playwright/main.js:9:3)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
at internal/main/run_main_module.js:17:11
(node:1704) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1704) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
// package.json
{
"name": "playwright",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"@types/node": "^13.1.8",
"playwright": "^0.9.21"
}
}
// main.ts
const playwright = require('playwright').chromium; // Or 'firefox' or 'webkit'.
(async () => {
const browser = await playwright.launch();
const context = await browser.newContext();
const page = await context.newPage('http://example.com');
// other actions...
await browser.close();
})();
Compiles to
"use strict";
// main.ts
const playwright = require('playwright').chromium; // Or 'firefox' or 'webkit'.
(async () => {
const browser = await playwright.launch();
const context = await browser.newContext();
const page = await context.newPage('http://example.com');
// other actions...
await browser.close();
})();
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Unable to install chromium using snap on WSL - Stack Overflow
The first problem is a bit trickier. On Ubuntu, Chromium is installed via Snap, which pretty much requires Systemd. Systemd, unfortunately, ...
Read more >How to install Chromium without snap? - Ask Ubuntu
This should install the latest chromium from the debian-security repository and look like this: $ sudo apt install chromium Reading package ...
Read more >Chromium not opening in WSL2 - Unix & Linux Stack Exchange
I managed to install chromium but the app simply fails to open without ... and I it doesn't look helpful in that case,...
Read more >Using WSL and MobaXterm to Create a Linux Dev ...
The Windows Subsystem for Linux (WSL) is ready for prime time. ... Before I go into how I set up the new development...
Read more >How to Install Chromium Web Browser on Ubuntu 20.04
The key difference between Chromium and Chrome is that Chromium is open-source. It Chromium doesn't include proprietary web codecs and doesn't ...
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
I am seeing this on macOS as well. The problem here is Yarn not installing the browsers; while
npm install
does.For mac OS, running
node node_modules/playwright/install.js
installed the browsers and resolved my issue. I couldn’t run npm because I was in yarn exclusive environment.