Fixing the "Failed to start the test" Error in VS Code / Cursor on macOS

Last updated: December 1, 2025

If your Test Render Preview fails with:

"Failed to start the test - try running your install command first."

and the terminal inside the editor appears empty or broken, this guide explains why it's happening and how to fix it.

This issue is often caused by VS Code or Cursor running certain background tasks using bash, while your macOS terminal uses zsh. Your tools (Node, npm, nvm, Homebrew) work in your normal terminal, but the editor can't find them. Because of this, Node, npm, nvm, and Homebrew may work fine in your terminal (zsh), but fail inside the extension (bash).

This guide explains how to fix it.


Symptoms

Inside VS Code or Cursor you may see errors like:

  • "Node not found"

  • "npm: command not found"

  • Project install/run commands failing

  • Tools that work in the terminal but fail inside the editor

This also includes the specific error: "Failed to start the test - try running your install command first." paired with an empty terminal.


Why This Happens

  • macOS switched the default shell to zsh (Catalina and later).

  • Most developers configure Homebrew/Node/NVM only in ~/.zshrc.

  • But some VS Code/Cursor extensions still execute tasks using bash.

  • As a result, bash does not know about your PATH settings.

So the editor can't find your tools, even though your terminal can.


How to Fix It

We need to add the environment variables to ~/.bash_profile so bash can find Homebrew, Node, NVM, etc.

Run these commands in your terminal:

1. Add Homebrew to bash

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.bash_profile

2. Add NVM to bash

echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bash_profile
echo '[ -s "$NVM_DIR/nvm.sh" ] && \\ . "$NVM_DIR/nvm.sh"' >> ~/.bash_profile

3. Restart VS Code / Cursor

Close and reopen the editor so the extension reloads the updated environment.


Result

After doing this:

  • VS Code and Cursor extensions will correctly detect Node, npm, nvm, etc.

  • Project run/install commands inside the editors should work normally again.