Robot Framework Browser library fails – Node.js not found (macOS)

Hello everyone,

I am trying to run Robot Framework tests using the Browser library on macOS.
The tests fail with an error related to Node.js.

Environment:

  • OS: macOS (MacBook Air 13.3.1)

  • Python: running inside a virtual environment (.venv)

  • Robot Framework: installed via pip

Problem:
When running the test, the following error appears:

Couldn't execute node. Please ensure you have node.js installed and in PATH.
Original error is [Errno 2] No such file or directory: 'node'

Even though Node.js is installed and works in the terminal (node -v),
Robot Framework / Browser library still cannot find it when executing the tests.

What was already tried:

  • Installed Node.js via Homebrew

  • Verified node -v and npm -v work in terminal

  • Ran rfbrowser init

  • Activated the Python virtual environment before running tests

Question:
Is this a known issue on macOS (especially with virtual environments or VS Code)?
Are there recommended steps to make sure Robot Framework Browser can find Node.js correctly?

Thank you very much for your help :slightly_smiling_face:

Hello,

welcome to the forum :waving_hand:

I sometimes get these errors, too, on fresh setups, for different reasons:

  1. Sometimes VSCode has not been restarted is not aware that node had been added to PATH
  2. I think once had a company setup that was so odd that node actually had been installed, but with a different name or something. I remember that I found the line of code inside Browser library that checks whether node is installed on startup. I disabled the check (comment it out) and it worked. But I don’t remember how I proceeded afterwards as that is not a long term solution.
  3. On Linux, I had once installed VSCode / Codium from flatbpack, which meant VSCode ran in an isolated sandbox and could not access system applications like proper terminal. Maybe there is a similar thing for MacOS where you accidentally can choose VSCode from a software manager and install it in an isolated sandbox?

If you find the solution, please share :slight_smile:

Kind regards,
Markus

without knowing the exact commands you ran and at which point you get that error message, hard to say ..

Hello Markus,

VS Code was restarted several times after installing Node.js, but the issue still occurs.

node -v works correctly in the terminal.

If a proper solution is found, it will definitely be shared here.

Thanks again for your help.

Hello,

thank you for your message.
Here are more details about the steps and where the error occurs:

  • Node.js was installed via Homebrew (brew install node)

  • node -v works in the terminal

  • Python virtual environment is activated

  • rfbrowser init runs without errors

  • The error appears when running a Robot Framework test that uses the Browser library

The exact error is:

Couldn't execute node. Please ensure you have node.js installed and in PATH.

This happens at test startup (suite setup), before any browser interaction.

Maybe you need to add node to the path:

$ which node

edit /etc/paths and add the directory for it

As alternative, browserlib can be used without external node installation if you dont need to install any external npm modules.

In addition to robotframework-browser, install also robotframework-browser-batteries pip module and instead of `rfbrowser init` you should just install the browsers you need ..

1 Like