esbuild wrong platform 📦 npm

You installed esbuild for another platform than the one you're currently using.

node_modules contains esbuild’s binary for a different OS/CPU.

Seen on: npm

Meaning

Same root cause as other native binaries: node_modules shared between host and container/VM (or Rosetta vs native on Apple Silicon).

Common causes

  • Bind-mounted node_modules from macOS into Linux
  • Installed under Rosetta, running natively (or vice versa)

⚡ Quick fix

  1. Reinstall in the target environment
  2. Don’t share node_modules between host and container (use a volume)

Detailed fix by platform

Docker

  1. volumes: ["./:/app", "/app/node_modules"]

How to diagnose

  1. Platform — Install vs run environment
  2. Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.