node.js – Playwright installation error: Failed to install browsers (ffmpeg) on Windows with Node version 20.14.0
I have a Windows laptop with the latest Node LTS version 20.14.0. I tried to install Playwright with the command npm init playwright@latest but I keep getting the below error:
Downloading browsers (npx playwright install)…
Downloading FFMPEG playwright build v1009 from https://playwright.azureedge.net/builds/ffmpeg/1009/ffmpeg-win64.zip
1.4 MiB [================ ] 78% 0.0sError: Download failed: server closed connection. URL: https://playwright.azureedge.net/builds/ffmpeg/1009/ffmpeg-win64.zip
at IncomingMessage. (C:\Users\...\e2e\node_modules\playwright-core\lib\server\registry\oopDownloadBrowserMain.js:89:24)
at IncomingMessage.emit (node:events:519:28)
at emitErrorNT (node:internal/streams/destroy:169:8)
at emitErrorCloseNT (node:internal/streams/destroy:128:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Downloading FFMPEG playwright build v1009 from https://playwright-akamai.azureedge.net/builds/ffmpeg/1009/ffmpeg-win64.zip
1.4 MiB [============== ] 71% 0.1sError: Download failed: server closed connection. URL: https://playwright-akamai.azureedge.net/builds/ffmpeg/1009/ffmpeg-win64.zip
at IncomingMessage. (C:\Users\...\e2e\node_modules\playwright-core\lib\server\registry\oopDownloadBrowserMain.js:89:24)
at IncomingMessage.emit (node:events:519:28)
at emitErrorNT (node:internal/streams/destroy:169:8)
at emitErrorCloseNT (node:internal/streams/destroy:128:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Downloading FFMPEG playwright build v1009 from https://playwright-verizon.azureedge.net/builds/ffmpeg/1009/ffmpeg-win64.zip
1.4 MiB [=============== ] 74% 0.1sError: Download failed: server closed connection. URL: https://playwright-verizon.azureedge.net/builds/ffmpeg/1009/ffmpeg-win64.zip
at IncomingMessage. (C:\Users\...\e2e\node_modules\playwright-core\lib\server\registry\oopDownloadBrowserMain.js:89:24)
at IncomingMessage.emit (node:events:519:28)
at emitErrorNT (node:internal/streams/destroy:169:8)
at emitErrorCloseNT (node:internal/streams/destroy:128:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Failed to install browsers
Error: Failed to download FFMPEG playwright build v1009, caused by
Error: Download failure, code=1
at ChildProcess. (C:\Users\...\e2e\node_modules\playwright-core\lib\server\registry\browserFetcher.js:91:16)
at ChildProcess.emit (node:events:519:28)
at ChildProcess._handle.onexit (node:internal/child_process:294:12)
Error: Command failed: npx playwright install
at genericNodeError (node:internal/errors:984:15)
at wrappedFn (node:internal/errors:538:14)
at checkExecSyncError (node:child_process:890:11)
at execSync (node:child_process:962:15)
at executeCommands (C:\Users\...\AppData\Local\npm-cache\_npx\d352e76cc6b4974c\node_modules\create-playwright\lib\index.js:4519:39)
at Generator.run (C:\Users\...\AppData\Local\npm-cache\_npx\d352e76cc6b4974c\node_modules\create-playwright\lib\index.js:4690:5)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async C:\Users\...\AppData\Local\npm-cache\_npx\d352e76cc6b4974c\node_modules\create-playwright\lib\index.js:4981:3 {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 23804,
stdout: null,
stderr: null
}
Not sure how to get rid of this error and install Playwright properly. Any help would be appreciated.
Read more here: Source link
