evanw/esbuild · error · Error

Cannot start service: Host version "${ESBUILD_VERSION}" does

Error message

Cannot start service: Host version "${ESBUILD_VERSION}" does not match binary version ${quote(binaryVersion)}

What it means

Error "Cannot start service: Host version "${ESBUILD_VERSION}" does not match binary version ${quote(binaryVersion)}" thrown in evanw/esbuild.

Source

Thrown at lib/shared/common.ts:621

        // cause an unhandled promise rejection. Our caller isn't expecting
        // this call to fail and doesn't handle the promise rejection.
      }
    }
  }

  let isFirstPacket = true

  let handleIncomingPacket = (bytes: Uint8Array<ArrayBuffer>): void => {
    // The first packet is a version check
    if (isFirstPacket) {
      isFirstPacket = false

      // Validate the binary's version number to make sure esbuild was installed
      // correctly. This check was added because some people have reported
      // errors that appear to indicate an incorrect installation.
      let binaryVersion = String.fromCharCode(...bytes)
      if (binaryVersion !== ESBUILD_VERSION) {
        throw new Error(`Cannot start service: Host version "${ESBUILD_VERSION}" does not match binary version ${quote(binaryVersion)}`)
      }
      return
    }

    let packet = protocol.decodePacket(bytes) as any

    if (packet.isRequest) {
      handleRequest(packet.id, packet.value)
    }

    else {
      let callback = responseCallbacks[packet.id]!
      delete responseCallbacks[packet.id]
      if (packet.value.error) callback(packet.value.error, {})
      else callback(null, packet.value)
    }
  }

View on GitHub (pinned to 6ff1d8b0d8)

Solutions

  1. Reinstall esbuild so the JS package and native binary versions match
  2. Delete node_modules and the lockfile entry for esbuild, then reinstall; ensure optional dependencies are installed

Example fix

rm -rf node_modules package-lock.json && npm install

When it happens

Trigger: Thrown at lib/shared/common.ts:621 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of evanw/esbuild@6ff1d8b0d8 (2026-08-03). Data as JSON: /data/errors/0b3f6d50902caaf5.json. Report an issue: GitHub.