If you are using AI agents or Playwright-based tools on Windows and encounter the following error:
failed to install playwright: $HOME environment variable is not set
This happens because the tool expects a Linux-style $HOME environment variable, which is not set by default on Windows (Windows uses %USERPROFILE%).
Solution
You can easily fix this by setting the HOME environment variable to your user profile path.
Run this command in PowerShell:
[System.Environment]::SetEnvironmentVariable('HOME', $env:USERPROFILE, 'User')
After running the command, restart your IDE or terminal for the changes to take effect.
Verified this fixes the browser launch issues in agentic workflows. Hope this helps anyone facing the same issue!