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
- Confirm Node is installed
Runnode -vandwhich npx(macOS/Linux) orwhere npx(Windows).which npx # e.g. /Users/you/.nvm/versions/node/v22.11.0/bin/npx - Use the absolute path to npx
Replace"npx"with the full path from the previous step.{ "mcpServers": { "memory": { "command": "/Users/you/.nvm/versions/node/v24.22.1/bin/npx", "args": ["-y", "@modelcontextprotocol/server-memory"] } } } - Or pass PATH explicitly
Add anenv.PATHthat includes the Node bin folder, so npx can also findnode."env": { "PATH": "/Users/you/.nvm/versions/node/v22.11.0/bin:/usr/local/bin:/usr/bin:/bin" } - Restart the client
Fully quit and reopen the app so it re-spawns the server.
Related servers
Memory & Reasoning● Maintained
Memory (Knowledge Graph)
Official reference server that gives the model persistent memory as a local knowledge graph (entities, relations and observations stored in a file). V
★ 92.4k · updated 2026-11-27
Files & OS● Maintained
Filesystem
Official reference server for reading, writing, searching and moving files, limited to the directories you allow. Version 2.4.1 (Nov 27, 2026, referen
★ 92.4k · updated 2026-11-27
Memory & Reasoning● Maintained
Sequential Thinking
Official reference server with a single tool for step-by-step, revisable problem solving. Version 2.2.0 (Nov 18, 2026, reference servers v2.5.0) can a
★ 92.4k · updated 2026-11-18