Fixes › Claude Desktop, Cursor

MCP server crashes because the client uses an old Node version

Claude DesktopCursor

The error

SyntaxError: Unexpected token '?' • ReferenceError: fetch is not defined • ERR_REQUIRE_ESM

Why it happens

With nvm installed, a GUI app may pick up an old system Node (e.g. v16) instead of your nvm default. Modern MCP servers need Node 18+ and often 20+.

How to fix it

  1. Check which Node the client sees
    Temporarily set command to node with args ["-v"] and read the log, or compare /usr/local/bin/node -v with node -v.
  2. Point at a modern Node directly
    Use the absolute npx path from your nvm version and put its bin folder first in PATH.
    {
      "command": "/Users/you/.nvm/versions/node/v22.11.0/bin/npx",
      "args": ["-y", "@upstash/context7-mcp"],
      "env": { "PATH": "/Users/you/.nvm/versions/node/v22.11.0/bin:/usr/bin:/bin" }
    }
  3. Or upgrade the system Node
    Install a current LTS from nodejs.org so every app gets it.

Related servers

Sources