Fallback when local Playwright is missing, fails to install, or browsers are not found. Uses pre-installed global Playwright from ~/.nvm/versions/node/v24.13.0/bin/playwright with browsers at ~/.cache/ms-playwright/
Use this skill when:
npx playwright fails with "command not found"npx playwright install chrome fails with "sudo required" or permission errorsnode_modules/playwright is missing or brokenAlready installed in this environment:
CLI: ~/.nvm/versions/node/v24.13.0/bin/playwright
Browsers: ~/.cache/ms-playwright/
- chromium-1208/
- firefox-1509/
- webkit-2248/
Version: 1.58.2
# Screenshot any URL
playwright screenshot <url> screenshot.png
# Example with viewport
playwright screenshot --viewport-size="390,844" <url> mobile.png
npx playwright screenshot <url> screenshot.png
const { chromium } = require('playwright');
// ... your code
Run with NODE_PATH:
NODE_PATH=~/.nvm/versions/node/v24.13.0/lib/node_modules node your-script.js
❌ Do NOT run:
npx playwright install chrome # Requires sudo, will fail
npx playwright install-deps # Requires sudo, will fail
npm install playwright # Not needed, use global
Verify global Playwright works:
which playwright # Should show: ~/.nvm/versions/node/v24.13.0/bin/playwright
playwright --version # Should show: Version 1.58.2
ls ~/.cache/ms-playwright/ # Should show: chromium-1208, firefox-1509, etc.
Taking screenshots for visual verification:
# After starting your dev server:
playwright screenshot http://localhost:<port> homepage.png
playwright screenshot --viewport-size="390,844" http://localhost:<port> mobile.png
For interactive pages (accordions, etc.), use Node.js with page.click() and page.waitForTimeout().