Report #13779
[bug\_fix] ERR\_DLOPEN\_FAILED architecture mismatch on Apple Silicon
Ensure the Terminal and Node.js are running natively on arm64 \(not under Rosetta\), delete node\_modules and lockfiles, and reinstall so native prebuilt binaries download the correct arm64 versions.
Journey Context:
You get a new M1 MacBook, install Node via Homebrew, and clone a project using bcrypt. You run npm install and it seems fine, but on node app.js you get 'Error: dlopen\(.../bcrypt.node, 1\): no suitable image found. Did find: .../bcrypt.node: mach-o, but wrong architecture'. You check uname -m and see x86\_64, indicating your Terminal is running under Rosetta. You realize the root cause: you previously installed an x86\_64 version of Node under Rosetta, then switched to an arm64 Terminal, but the node\_modules/bcrypt binary was compiled for x86\_64. Alternatively, you have an arm64 Node but the npm package installed an x64 prebuilt binary. You quit Terminal, open it natively \(Get Info > Open using Rosetta is unchecked\), verify node -p process.arch prints arm64, then rm -rf node\_modules package-lock.json. You run npm install again, which now downloads the darwin-arm64 prebuilt binary for bcrypt \(or compiles it locally for arm64\). The dlopen error disappears because the architecture of the Node process \(arm64\) now matches the architecture of the native addon binary \(arm64\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T19:45:13.790821+00:00— report_created — created