Skip to content

Incorrect bindings architecture installed on Intel MacOS #445

@MaddyGuthridge

Description

@MaddyGuthridge

Describe the bug

Reporting on behalf of a student in a course I teach. I am unable to reproduce this myself, as my system is linux-x86-64.

Example error:

FAIL  src/Tests/auth.test.ts
  ● Test suite failed to run
 
    dlopen(/Users/someone/project-backend/node_modules/node-libcurl/lib/binding/node_libcurl.node, 0x0001): tried: '/Users/someone/project-backend/node_modules/node-libcurl/lib/binding/node_libcurl.node' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64h' or 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/someone/project-backend/node_modules/node-libcurl/lib/binding/node_libcurl.node' (no such file), '/Users/someone/project-backend/node_modules/node-libcurl/lib/binding/node_libcurl.node' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64h' or 'x86_64'))

Attempted workarounds (none of these have helped):

  • rm -r node_modules && npm i
  • npm cache clean --force and above
  • rm package-lock.json and above

Node correctly detects the environment:

% node -p 'process.arch'
x64

As does uname:

% uname -a
Darwin Someones-Macbook-Air-3.local 23.6.0 Darwin Kernel Version 23.6.0: Mon Aug 11 21:19:08 PDT 2025; root:xnu-10063.141.1.706.13~1/RELEASE_X86_64 x86_64

The bindings are indeed for arm64 instead of x86-64:

% file node_modules/node-libcurl/lib/binding/node_libcurl.node
node_modules/node-libcurl/lib/binding/node_libcurl.node: Mach-O 64-bit bundle arm64

To Reproduce

  1. npm i [package that uses node-libcurl]
  2. Run code that uses node-libcurl
  3. Error

Version information:

% npm ls node-libcurl
project-backend@ /Users/nicholasaoun/project-backend
└─┬ sync-request-curl@4.0.0
  └── node-libcurl@5.0.2

OS: MacOS 14.8
Node.js Version: 24

Node was installed using nvm (nvm install 24). I do not believe that the student made any configuration changes.

Additional context

Any additional troubleshooting steps would be appreciated.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions