-
Notifications
You must be signed in to change notification settings - Fork 5k
Description
I am still new to Docker so I am wondering how to execute the simplest playwright JS with node as the dockerfile provided in https://github.com/microsoft/playwright/blob/master/docs/docker/Dockerfile.bionic does not npm install playwright globally.
I ran this script:
const playwright = require('playwright'); (async () => { for (const browserType of ['chromium', 'firefox', 'webkit']) { const browser = await playwright[browserType].launch({headless: true, args: ['--no-sandbox']}); const context = await browser.newContext(); const page = await context.newPage(); await page.goto('http://whatsmyuseragent.org/'); await page.screenshot({ path: example-${browserType}.png}); await browser.close(); } })();
but I get error Error: Cannot find module 'playwright'
Any help is much appreciated fellow coders.