How to fix npm ERR! code ENOTSUP npm ERR! notsup Unsupported CPU: {"cpu":"x64"} (current: {"cpu":"arm64"}) in npm

npmBEGINNERMEDIUMUpdated Dec 6, 2025· 225 views

The ENOTSUP CPU error occurs when npm packages contain native binaries built for a different processor architecture (x64 vs arm64). This commonly happens on Apple Silicon Macs or when copying node_modules between systems. Delete node_modules and reinstall on the target machine.

Quick fix

Fixes ENOTSUP

rm -rf node_modules package-lock.json
npm install
  1. Delete node_modules and reinstall
  2. Verify your Node.js architecture
  3. Use nvm to manage Node.js installations
  4. Fix Docker architecture mismatches
npm — error
rm -rf node_modules package-lock.json
npm install
npm ERR! code ENOTSUP
npm ERR! notsup Unsupported CPU: {"cpu":"x64"} (current: {"cpu":"arm64"})

What this error means

This error occurs when npm packages include prebuilt native binaries compiled for a specific CPU architecture, but you're trying to run them on a different architecture. The most common scenario is x64 (Intel/AMD) vs arm64 (Apple Silicon, AWS Graviton, Raspberry Pi). When you install packages like esbuild, sharp, or other native modules, npm downloads binaries matching your system's architecture. If those binaries are then executed on a different architecture—such as copying node_modules from an Intel Mac to an M1 Mac—they won't run. This error has become increasingly common since Apple's transition to Apple Silicon (M1/M2/M3 chips) and the growing adoption of ARM-based servers.

Typical symptoms

  • Error mentions x64 vs arm64 architecture mismatch
  • Package installed on one machine but fails on another
  • Works on Intel Mac but fails on Apple Silicon Mac (or vice versa)
  • Docker container fails with architecture errors
  • CI/CD builds fail while local development works
  • Error message: 'binaries cannot be used on the [arch] platform'
  • npx commands fail to find locally installed packages

Common causes

  1. Copying node_modules between machines with different CPU architectures
  2. Installing packages with Rosetta (x64 emulation) then running native arm64 Node.js
  3. Docker image architecture doesn't match host system
  4. CI/CD runner uses different architecture than deployment target
  5. Mixed Node.js installations (some x64, some arm64) on Apple Silicon
  6. Using node_modules from a mounted volume across different architectures

How to fix "npm ERR! code ENOTSUP npm ERR! notsup Unsupported CPU: {"cpu":"x64"} (current: {"cpu":"arm64"})"

1Delete node_modules and reinstall

The most reliable fix is a clean reinstall on the target architecture:

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

This downloads binaries matching your current system's architecture.

2Verify your Node.js architecture

Check which architecture Node.js is running:

bash
node -p "process.arch"

On Apple Silicon, this should return arm64 for native mode or x64 if running under Rosetta. Ensure you're using the correct Node.js build for your system.

3Use nvm to manage Node.js installations

Install nvm and ensure you have native arm64 Node.js on Apple Silicon:

bash
# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash

# Install native arm64 Node.js
nvm install 20
nvm use 20

# Verify
node -p "process.arch"  # Should show "arm64"
4Fix Docker architecture mismatches

Specify the correct platform in Docker:

dockerfile
# For arm64 (Apple Silicon, Graviton)
FROM --platform=linux/arm64 node:20

# For x64 (Intel/AMD)
FROM --platform=linux/amd64 node:20

Or set the platform when building:

bash
docker build --platform linux/amd64 -t myapp .
5Never copy node_modules between systems

Add node_modules to .gitignore and .dockerignore:

bash
# .gitignore and .dockerignore
node_modules/

Always run npm install or npm ci on the target system rather than copying node_modules from another machine.

6Force specific architecture during install

For packages that support it, specify the target architecture:

bash
npm install --arch=arm64 --platform=darwin sharp

This downloads binaries for the specified architecture regardless of your current system.

Advanced notes

On Apple Silicon Macs, you might have multiple Node.js installations: one native arm64 (fast) and one x64 running under Rosetta (slower but compatible with older packages). Check with which node and file $(which node) to see which you're using.

If you installed Node.js via Homebrew on an Apple Silicon Mac before 2021, you might have the x64 version. Reinstall Homebrew and Node.js to get native arm64 builds:

bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install node

For CI/CD on GitHub Actions, use the runs-on directive to match your deployment architecture:

yaml
jobs:
  build:
    runs-on: ubuntu-latest  # x64
    # or
    runs-on: macos-latest   # arm64 on newer runners

Some packages like esbuild publish architecture-specific packages (@esbuild/darwin-arm64, @esbuild/linux-x64). If you see errors about these optional dependencies, your package.json or lockfile may have the wrong architecture specified.

Frequently asked questions

What does "ENOTSUP" mean?
This error occurs when npm packages include prebuilt native binaries compiled for a specific CPU architecture, but you're trying to run them on a different architecture. The most common scenario is x64 (Intel/AMD) vs arm64 (Apple Silicon, AWS Graviton, Raspberry Pi). When you install packages like esbuild, sharp, or other native modules, npm downloads binaries matching your system's architecture.
How do I fix "ENOTSUP"?
The ENOTSUP CPU error occurs when npm packages contain native binaries built for a different processor architecture (x64 vs arm64). This commonly happens on Apple Silicon Macs or when copying node_modules between systems. Delete node_modules and reinstall on the target machine.
What causes "ENOTSUP"?
Copying node_modules between machines with different CPU architectures Installing packages with Rosetta (x64 emulation) then running native arm64 Node.js Docker image architecture doesn't match host system
Is the "ENOTSUP" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading