Install playwright on node js

I am trying to install Playwright on my Node.js server but I’m encountering an error stating that the executable doesn’t exist at the specified path. It works fine locally, but not on Vercel.

It says the following message (even though i ran that command already):

Error: browserType.launch: Executable doesn’t exist at /home/sbx_user1051/.cache/ms-playwright/chromium-1155/chrome-linux/chrome
╔═════════════════════════════════════════════════════════════════════════╗
║ Looks like Playwright Test or Playwright was just installed or updated. ║
║ Please run the following command to download new browsers: ║
║ ║
║ npx playwright install ║
║ ║
║ <3 Playwright Team ║
╚═════════════════════════════════════════════════════════════════════════╝

Has anyone successfully installed playwright on their node js server?

Thanks!

If you are planning to deploy at Vercel, this is a great start: Testing: Playwright | Next.js

2 Likes

How the come the code here doesn’t need to run “npx playwright install”

Also, i’m running playwright in my code, not for testing purposes

Playwright is focused on testing scenarios, so running it outside of local/CI environments is out of the project scope, sorry!

However, npx playwright install chromium should work on most systems. If you cannot run it in advance, try running it programmatically before using playwright.

I will recommend reaching out to Playwright community to seek help further.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.