N8n-nodes-playwright do not seem to be adapted for Mac, or am I missing something?

Describe the problem/error/question

Hi! I tried to switch from Puppeteer nodes to Playwright, but stumbled upon number of issues which seem to be related to Mac platform, which is a bit confusing as I expected myself to be not the first Mac user of n8n with Playwright.

The problem is that n8n-nodes-playwright package seems to be not adapted to Mac paths in comparison to Linux ones.

For example when it installs - it puts cache files into “/Users/myuser/Library/Caches/ms-playwright” but then looks for them under “/Users/myuser/.cache/ms-playwright”, which are not there. I resolved this problem by putting a corresponding symlink.

Second problem I encountered was that when one tries to execute a Playwright n8n node - it looks for Chrome under “browsers/chromium-1194/chrome-mac/Chrome“ but on Mac Chrome installs as “browsers/chromium-1194/chrome-mac/Chromium.app”. And this problem I could not resolve with a symlink because n8n launch automatically reinstalls Chrome and clears the aforementioned path.

And I could not find any settings or a config file to modify to put the right Chromium path for Playwright which is not getting reinstalled upon n8n start.

Could somebody point me to the right direction ? (launching a linux or windows host is plan C)

What is the error message (if any)?

File or path not found in both cases.

Please share your workflow

Probably no reason to share a workflow as it consists of a single "Playwright Navigate" node

Share the output returned by the last node

n/a

Information on your n8n setup

  • n8n version: 1.118.2
  • Database (default: SQLite): n/a
  • n8n EXECUTIONS_PROCESS setting (default: own, main): n/a
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Mac

This appears to be a known issue with the n8n-nodes-playwright package on Mac systems. Based on similar issues in the [GitHub repositories](browser doesn't open on mac · Issue #13456 · microsoft/playwright · GitHub), the problem stems from Playwright’s browser installation paths being different on macOS compared to Linux.

Here are some potential solutions to try:

• **Set environment variables** to override the browser paths:

  • Try setting `PLAYWRIGHT_BROWSERS_PATH` to point to the correct Mac installation directory

  • You might also need to set `CHROMIUM_BIN` to the full path of the Chromium executable

• **Check the n8n-nodes-playwright configuration** - look for any config files or environment variables specific to the package that might allow you to specify custom browser paths

• **Consider using Docker** - Running n8n in a Docker container with Linux would ensure consistent Playwright behavior and avoid Mac-specific path issues

The symlink approach you tried is creative, but as you discovered, it gets overwritten when n8n reinstalls browsers. Setting the proper environment variables should be more persistent and is the recommended approach based on similar [Playwright issues]([Bug]: Running Chrome using `launchOptions` will lose out to `PLAYWRIGHT_BROWSERS_PATH` under Bazel if `npx playwright install` run · Issue #31471 · microsoft/playwright · GitHub).

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