playwright: [BUG] Failed to launch chromium because executable doesn't exist
Edit from the Playwright team 📣
npx playwright install
Will fix it and install your browsers as expected.
I am attempting to install Playwright but cannot get past the following error when trying to run a basic test:
Failed to launch chromium because executable doesn't exist at /Users/danawoodman/Library/Caches/ms-playwright/chromium-799411/chrome-mac/Chromium.app/Contents/MacOS/Chromium
Try re-installing playwright with "npm install playwright"
Note: use DEBUG=pw:api environment variable and rerun to capture Playwright logs.
at Chromium._launchProcess (node_modules/playwright/lib/server/browserType.js:123:19)
at async Chromium._innerLaunch (node_modules/playwright/lib/server/browserType.js:66:75)
at async ProgressController.run (node_modules/playwright/lib/server/progress.js:74:28)
at async Chromium.launch (node_modules/playwright/lib/server/browserType.js:54:25)
at async BrowserServerLauncherImpl.launchServer (node_modules/playwright/lib/browserServerImpl.js:32:25)
at async PlaywrightRunner.getTests (node_modules/jest-playwright-preset/lib/PlaywrightRunner.js:56:56)
at async PlaywrightRunner.runTests (node_modules/jest-playwright-preset/lib/PlaywrightRunner.js:87:30)
at async TestScheduler.scheduleTests (node_modules/@jest/core/build/TestScheduler.js:321:13)
at async runJest (node_modules/@jest/core/build/runJest.js:372:19)
The file ~/Library/Caches/ms-playwright/chromium-799411/chrome-mac/Chromium.app/Contents/MacOS/Chromium does not exist but this folder does ~/Library/Caches/ms-playwright/chromium-799411/chrome-mac/Chromium.app/Contents/Frameworks/Chromium\ Framework.framework. Not sure why it is looking in the wrong location?
I have ran yarn add playwright and the package appears to install successfully. I’ve also tried to manually run node node_modules/playwright/install.js which gives me:
Removing unused browser at /Users/danawoodman/Library/Caches/ms-playwright/chromium-799411
Downloading chromium v799411 - 118.1 Mb [====================] 100% 0.0s
I’ve also attempted to remove node_modules, yarn.lock and ~/Library/Caches/ms-playwright to reset things to a clean state but nothing is working. I’m at a losss for what to do and Googling/searching issues doesn’t get me anything useful.
I don’t think there is anything particularly unique with my setup.
Is there a way to better troubleshoot why I can’t get Playwright to work?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 45 (8 by maintainers)
Commits related to this issue
- fix: build https://github.com/microsoft/playwright/issues/1988 https://github.com/microsoft/playwright/issues/4033#issuecomment-702325569 bumped the gh actions node version b/c of above Signed-off-... — committed to hippee-lee/clarity by hippee-lee 3 years ago
- fix: build https://github.com/microsoft/playwright/issues/1988 https://github.com/microsoft/playwright/issues/4033#issuecomment-702325569 bumped the gh actions node version b/c of above Signed-off-... — committed to hippee-lee/clarity by hippee-lee 3 years ago
- fix: realistic group demos Note: I'm changing the build workflow node version in the commit also to address the re-occuring and intermittent issues with builds failing b/c of playwright not being dow... — committed to hippee-lee/clarity by hippee-lee 3 years ago
- fix: realistic group demos Note: I'm changing the build workflow node version in the commit also to address the re-occuring and intermittent issues with builds failing b/c of playwright not being dow... — committed to vmware-archive/clarity by hippee-lee 3 years ago
I am getting this issue now while using the pw docker image. https://hub.docker.com/_/microsoft-playwright. Running
npm install playwrightas part of the execution fix the issue.Thanks! I agree with you in principle. This issue was caused by a change in Nodejs: https://github.com/nodejs/node/issues/33050
@BrunoQuaresma
This is a know issue for a long but we resolved it in our CI.
I wrote medium post on the approach we took - https://gkushang.medium.com/playwright-failed-to-launch-browsers-how-to-solve-8b01d03fe5b9
Refer to prev issue: https://github.com/microsoft/playwright/issues/5767#issuecomment-898813860
and the comment above: https://github.com/microsoft/playwright/issues/4033#issuecomment-855276404
I am using node v.14.15.1, but this issue is still there.
I solved this by removing the node_modules and reinstall again.
rm -rf node_modulesnpm iI banged my head against the wall for far too long on this before realizing that it was because
npx playwright installwas installing a different version of chromium thannpx playwright testwas looking for. Depressingly enough, this all came down to me not checking package-lock.json into source control.@ssurabhi10 I’d be willing to be that if you add something like an
ls -al /home/runner/.cache/ms-playwright/somewhere in your steps, it would show you existence of a folder calledchromium-907428instead ofchromium-901522. This is exactly what was facing me. I fixed it by deleting all my node_modules locally, setting all of my playwright-related npm module versions to precisely “1.14.0” and installing once more, then committing the generated package-lock.json. This worked for me.@StfBauer please create a new issue with the error etc.
Same problem with node v15.5.0 on WSL
Thanks! We saw issues with Node 14.0.0 and the fix is to upgrade to 14.1.0. Relevant previous issue: https://github.com/microsoft/playwright/issues/1988