Fixes › Claude Desktop, Cursor, Windsurf

Fix "spawn npx ENOENT" when starting an MCP server

Claude DesktopCursorWindsurf

The error

Error: spawn npx ENOENT

Why it happens

The app launched the server without your shell's PATH, so it cannot find npx. This is common with nvm, fnm, Volta, or Homebrew installs, because GUI apps do not load ~/.zshrc / ~/.bashrc.

How to fix it

  1. Confirm Node is installed
    Run node -v and which npx (macOS/Linux) or where npx (Windows).
    which npx
    # e.g. /Users/you/.nvm/versions/node/v22.11.0/bin/npx
  2. Use the absolute path to npx
    Replace "npx" with the full path from the previous step.
    {
      "mcpServers": {
        "memory": {
          "command": "/Users/you/.nvm/versions/node/v22.11.0/bin/npx",
          "args": ["-y", "@modelcontextprotocol/server-memory"]
        }
      }
    }
  3. Or pass PATH explicitly
    Add an env.PATH that includes the Node bin folder, so npx can also find node.
    "env": { "PATH": "/Users/you/.nvm/versions/node/v22.11.0/bin:/usr/local/bin:/usr/bin:/bin" }
  4. Restart the client
    Fully quit and reopen the app so it re-spawns the server.

Related servers

Sources