Quick fix: spawn npx ENOENT means the app tried to start your MCP server with the command npx and found no file of that name on the PATH it was given. The usual reason is that Claude Desktop, Cursor and other GUI apps do not read your shell profile, so a Node installed through nvm, fnm, Volta, mise or Homebrew is invisible to them. Run which npx (macOS, Linux) or where npx (Windows), put that absolute path in command, and give the server a PATH that includes the same folder, then fully quit and reopen the app:

{
  "mcpServers": {
    "filesystem": {
      "command": "/opt/homebrew/bin/npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/yourname/Projects/demo"],
      "env": { "PATH": "/opt/homebrew/bin:/usr/bin:/bin" }
    }
  }
}

Replace /opt/homebrew/bin with the folder your own which npx printed. On Windows the fix is different: wrap the command in cmd /c (see the Windows cause below).

The exact error

This is Node.js's own error text, so every MCP host built on Node prints the same line. We reproduced it on Node 25.9.0 by spawning commands with a stripped-down PATH, which is what a GUI app often has:

Error: spawn npx ENOENT
code: ENOENT | syscall: spawn npx | path: npx

Error: spawn uvx ENOENT
Error: spawn node ENOENT
Error: spawn /opt/does/not/exist/npx ENOENT

The word after spawn is whatever is in your command field, so the same page applies to spawn uvx ENOENT, spawn node ENOENT, spawn python ENOENT or spawn docker ENOENT. Node sets the syscall name to 'spawn ' + this.spawnfile in its lib/internal/child_process.js and appends the error code.

Claude Code words it differently. With version 2.1.325 and the same stripped PATH, claude mcp get printed:

  Status: ✘ Failed to connect
  Issue: ENOENT: Executable not found in $PATH: "npx"

Where to look for it:

  • Claude Desktop: mcp.log (connection failures) and mcp-server-NAME.log (the server's stderr) in ~/Library/Logs/Claude on macOS, %APPDATA%\Claude\logs on Windows and ~/.config/Claude/logs on Linux. Follow them live with tail -n 20 -f ~/Library/Logs/Claude/mcp*.log.
  • Claude Code: claude mcp list appends the failure detail to the ✘ Failed to connect status, claude mcp get NAME shows it on an Issue: line, and /mcp inside a session shows the same. For more, start Claude Code with claude --debug=mcp.
  • Cursor: open the Output panel (Cmd+Shift+U on macOS, Ctrl+Shift+U on Windows and Linux) and choose MCP Logs.

Why it happens

ENOENT is the operating system's "no such file or directory" code. A local (stdio) MCP server is just a program the app launches as a child process. When command is a bare name like npx, the operating system looks for it in each folder of the PATH variable the app passes along. The MCP debugging guide warns that stdio servers "inherit only a limited subset of environment variables automatically", and PATH is the copy the app itself was started with.

That is the trap. Your terminal's PATH comes from ~/.zshrc, ~/.bashrc or a version manager's init script. An app opened from the Dock, Finder or Start menu never runs those files. On macOS such apps typically get launchd's standard path, which the macOS SDK defines as /usr/bin:/bin:/usr/sbin:/sbin, with no Homebrew or nvm folder in it. So npx works in Terminal and fails in the app.

Node's documentation adds a second, less obvious trigger: ENOENT is also emitted when the working directory (cwd) passed to spawn does not exist. We confirmed it: spawning npx with a missing cwd printed Error: spawn npx ENOENT even though npx was installed.

Find your cause

CauseHow to recognise itFix
GUI app does not see your shell PATH (nvm, fnm, Volta, mise, Homebrew)npx --version works in Terminal; the app fails; macOS or LinuxAbsolute path in command plus a PATH in env
Absolute npx path but no node on PATHLog shows env: node: No such file or directory instead of ENOENTAdd Node's folder to env.PATH
Windows: npx is really npx.cmdWindows only; fails even though where npx finds it"command": "cmd" with "args": ["/c", "npx", ...]
Node (or uv) is not installedwhich npx or where npx prints nothing in a fresh terminalInstall Node.js (or uv for uvx), then use its absolute path
Typo or wrong absolute path in commandError names a full path, such as spawn /opt/does/not/exist/npx ENOENTCopy the path again from which/where
Missing working directory or relative pathCommand exists but still ENOENT; config uses ./ pathsUse absolute paths everywhere

GUI app does not see your shell PATH

Find the real location of the tool in a normal terminal, then use it in the config.

# macOS / Linux
which npx
which node

What you get depends on how Node was installed, and some answers are a trap:

  • Homebrew: the default prefix is /opt/homebrew on Apple Silicon and /home/linuxbrew/.linuxbrew on Linux, so /opt/homebrew/bin/npx is typical.
  • nvm: versions live under ~/.nvm/versions/node/vX.Y.Z/bin. nvm which current prints the active node. The path contains the version number, so update the config when you switch default versions.
  • fnm: which node points into a per-shell fnm_multishells folder that fnm recreates for each terminal, so do not copy it. Run fnm env, read FNM_DIR, and use $FNM_DIR/aliases/default/bin, which is a link to your default version.
  • Volta: shims are in ~/.volta/bin. Note that Volta's README now says "Volta is unmaintained" and recommends mise.
  • mise: its docs recommend putting the shims folder, ~/.local/share/mise/shims, on PATH "for editors and other programs that never see an activated shell".
  • uv / uvx: the standalone installer puts uv and uvx in $XDG_BIN_HOME, or $HOME/.local/bin when that is unset.

Then write both the absolute command and an env.PATH, as in the quick fix. The MCP debugging guide documents the env key for exactly this: "To override the default variables or provide your own". The same JSON works in Claude Desktop's claude_desktop_config.json, Cursor's mcp.json, and Claude Code's .mcp.json or claude mcp add-json. For Claude Code from the command line:

claude mcp add filesystem --env PATH=/opt/homebrew/bin:/usr/bin:/bin -- \
  /opt/homebrew/bin/npx -y @modelcontextprotocol/server-filesystem "$HOME/Projects/demo"

Cursor's help page adds one more option: if your server relies on variables from your shell profile, make sure Cursor can see them and "Restart Cursor after updating your shell profile."

Absolute npx path, but node is still missing

This catches people who apply only half the fix. npx is a script whose first line is #!/usr/bin/env node, so it needs node on PATH too. Run with only the system PATH, the absolute path fails like this:

$ /opt/homebrew/bin/npx --version      # PATH=/usr/bin:/bin:/usr/sbin:/sbin
env: node: No such file or directory
exit code: 127

With /opt/homebrew/bin added to PATH, the same call printed 11.12.1 and exited 0. That is why the quick fix sets env.PATH as well as command. The same applies to any package that runs further Node processes.

Windows: use cmd /c

On Windows, npx is installed as a batch file, npx.cmd. Node's documentation explains that ".bat and .cmd files are not executable on their own without a terminal" and must be started through cmd.exe or a shell. The official servers README therefore says: "On Windows, wrap npx with cmd /c":

{
  "mcpServers": {
    "memory": {
      "command": "cmd",
      "args": ["/c", "npx", "-y", "@modelcontextprotocol/server-memory"]
    }
  }
}

Use double backslashes in any Windows path inside JSON (C:\\Users\\you\\Projects). If Claude Desktop's server log shows ENOENT next to a path containing ${APPDATA}, the MCP connect guide says to add the expanded value to the server's env, for example "APPDATA": "C:\\Users\\user\\AppData\\Roaming\\".

Node or uv is not installed

Open a brand-new terminal and run node --version and npx --version (or uvx --version). If either says "command not found", install Node.js from nodejs.org (the newest LTS line on 14 November 2026 is Node 26, "Lithium") or uv from its official installer, then return to the first fix and use absolute paths.

Wrong path, missing folder or relative path

When command is a full path, the error repeats it, which makes typos easy to spot: spawn /opt/does/not/exist/npx ENOENT. Copy the path again from which or where. The debugging guide also warns that a server started from an app's config may have an undefined working directory "(like / on macOS)", so a command such as ./server.js fails with spawn ./server.js ENOENT (we reproduced that too). Use absolute paths in command, args and any cwd setting, or ${workspaceFolder} in Cursor.

Check it is fixed

First prove the exact command works with the app's poor PATH. On macOS or Linux, env -i starts a command with an empty environment, so this mimics the GUI app:

env -i PATH=/opt/homebrew/bin:/usr/bin:/bin /opt/homebrew/bin/npx --version

You should see an npm version number, not an error. Then restart the app and check:

  • Claude Desktop: fully quit and reopen; the server appears under Connectors with its tools, and mcp.log shows no new ENOENT line.
  • Claude Code: claude mcp list shows ✔ Connected next to the server.
  • Cursor: the server is enabled in Customize > MCPs and MCP Logs shows it starting.
  • ENOENT: Executable not found in $PATH: "npx": Claude Code's wording of the same problem in claude mcp list and claude mcp get. Same fixes.
  • env: node: No such file or directory: the command was found but node was not. Add Node's folder to env.PATH.
  • spawn uvx ENOENT: identical cause for Python servers run through uv. Use the absolute path from which uvx.
  • spawn claude ENOENT: Claude Code's MCP docs list this for Claude Code configured as a server in Claude Desktop; the fix is the full path to the claude executable.

What to do next

FAQ

Why does npx work in my terminal but not in Claude Desktop?

Your terminal loads your shell profile, which adds Homebrew, nvm or fnm folders to PATH. An app launched from the Dock or Start menu does not, and MCP servers get a copy of the app's PATH. Use absolute paths and set env.PATH.

Do I need to install npm globally to fix spawn npx ENOENT?

Not on macOS or Linux. The MCP connect guide mentions npm install -g npm only for Windows, when npx keeps failing and %APPDATA%\npm does not exist. Try cmd /c and absolute paths first.

How do I fix spawn uvx ENOENT for a Python MCP server?

The same way. Find the binary with which uvx (usually ~/.local/bin/uvx), put the full path in command, and add that folder to env.PATH.

Is there a way to avoid Node path problems in Claude Desktop entirely?

For servers packaged as Desktop Extensions (MCPB bundles), yes: the MCPB README says "Node.js ships with Claude for macOS and Windows", so those bundles do not depend on your own Node install.

Can I just copy the path from which node when I use nvm or fnm?

With nvm, yes, but it includes the version number and breaks when you remove that version. With fnm, no: that path is a per-terminal link. Use $FNM_DIR/aliases/default/bin instead.

How this fix was verified

Reproduced here on 14 November 2026, on macOS 26.5 on Apple M4 with Node 25.9.0, npm 11.12.1 and Claude Code 2.1.325: a small child_process.spawn() script with PATH set to /usr/bin:/bin:/usr/sbin:/sbin produced spawn npx ENOENT, spawn uvx ENOENT, spawn node ENOENT and the absolute-path variant; calling Homebrew's npx by full path with the same PATH produced env: node: No such file or directory (exit 127), and adding /opt/homebrew/bin to PATH fixed it; a missing cwd and a relative ./server.js both produced ENOENT. For Claude Code, we pointed HOME at a scratch folder holding a throwaway .claude.json, ran claude mcp list and claude mcp get with the minimal PATH, and saw the Executable not found in $PATH wording. No real Claude, Claude Desktop or Cursor configuration was read or changed.

Checked against official docs and source only, not executed: the Windows cmd /c and APPDATA fixes, the Claude Desktop and Cursor log locations and UI steps, the fixed-config results in Claude Desktop and Cursor, and the nvm, fnm, Volta, mise, uv and Homebrew paths (from each project's README, docs or source). Sources: modelcontextprotocol.io (debugging, connect-local-servers), code.claude.com/docs/en/mcp, cursor.com/docs/mcp and Cursor's MCP help page, the Node.js child_process docs and source, the modelcontextprotocol/servers and mcpb READMEs, and the macOS SDK's paths.h.

Last verified: 14 November 2026.

We re-check this fix monthly and record any change in this page's changelog.