Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing darwin-arm64 build #1018

Open
rami-carma opened this issue Dec 20, 2023 · 3 comments
Open

Missing darwin-arm64 build #1018

rami-carma opened this issue Dec 20, 2023 · 3 comments

Comments

@rami-carma
Copy link

I am on Apple silicon (M1 Chip) and I am attempting to install bcrypt onto my node.js project (node version:16.16.0) and keep hitting a 404 error on bcrypt 5.0.0.

there seems to be a missing build for this version on darwin-arm64 (which exists on version 5.1.1)

the following errors were thrown when attempting to download

npm ERR! node-pre-gyp info check checked for "/Users/rami/Project/nodejs_public_insight_api/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node" (not found)
npm ERR! node-pre-gyp http GET https://github.com/kelektiv/node.bcrypt.js/releases/download/v5.0.0/bcrypt_lib-v5.0.0-napi-v3-darwin-arm64-unknown.tar.gz
npm ERR! node-pre-gyp http 404 https://github.com/kelektiv/node.bcrypt.js/releases/download/v5.0.0/bcrypt_lib-v5.0.0-napi-v3-darwin-arm64-unknown.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v5.0.0/bcrypt_lib-v5.0.0-napi-v3-darwin-arm64-unknown.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not found for bcrypt@5.0.0 and node@16.16.0 (node-v93 ABI, unknown) (falling back to source compile with node-gyp)

@leftstick
Copy link

same issue, any update?

@cihy2
Copy link

cihy2 commented Jan 24, 2024

It works for me:

Issue Description

Problem

Encountered an error related to the bcrypt module in a Node.js application running on an arm64 architecture (Apple Silicon, M1/M2 chips). The error indicates a mismatch in the compiled architecture of the bcrypt module (compiled for x86_64) and the running Node.js process (requires arm64).

Error Message

Error: dlopen(/Users/cichy/Praca/Wlasne/oxapps/oxdata/ox-be/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node, 0x0001): tried: '/Users/cichy/Praca/Wlasne/oxapps/oxdata/ox-be/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/cichy/Praca/Wlasne/oxapps/oxdata/ox-be/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node' (no such file), '/Users/cichy/Praca/Wlasne/oxapps/oxdata/ox-be/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

Steps to Resolve

  1. Ensure Correct Node.js Version: Verify using node -v and arch commands. arch should return arm64.
  2. Clear Existing Modules:
    • Remove node_modules and package-lock.json:
      rm -rf node_modules
      rm package-lock.json
  3. Reinstall Node Modules:
    • Run npm install or yarn to reinstall dependencies.
  4. Rebuild Specific Modules:
    • Explicitly rebuild bcrypt for arm64:
      npm rebuild bcrypt --build-from-source
  5. Retry Running the Application.

Alternative Solution

  • Use an x86_64 emulation mode (Rosetta) to run the Node.js process, if native arm64 resolution fails.

Additional Notes

  • Ensuring consistent use of Node.js binaries matching the system architecture (development/production) is crucial to avoid such issues.

@johnreyev
Copy link

It works for me:

Issue Description

Problem

Encountered an error related to the bcrypt module in a Node.js application running on an arm64 architecture (Apple Silicon, M1/M2 chips). The error indicates a mismatch in the compiled architecture of the bcrypt module (compiled for x86_64) and the running Node.js process (requires arm64).

Error Message

Error: dlopen(/Users/cichy/Praca/Wlasne/oxapps/oxdata/ox-be/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node, 0x0001): tried: '/Users/cichy/Praca/Wlasne/oxapps/oxdata/ox-be/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/cichy/Praca/Wlasne/oxapps/oxdata/ox-be/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node' (no such file), '/Users/cichy/Praca/Wlasne/oxapps/oxdata/ox-be/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

Steps to Resolve

  1. Ensure Correct Node.js Version: Verify using node -v and arch commands. arch should return arm64.

  2. Clear Existing Modules:

    • Remove node_modules and package-lock.json:
      rm -rf node_modules
      rm package-lock.json
  3. Reinstall Node Modules:

    • Run npm install or yarn to reinstall dependencies.
  4. Rebuild Specific Modules:

    • Explicitly rebuild bcrypt for arm64:
      npm rebuild bcrypt --build-from-source
  5. Retry Running the Application.

Alternative Solution

  • Use an x86_64 emulation mode (Rosetta) to run the Node.js process, if native arm64 resolution fails.

Additional Notes

  • Ensuring consistent use of Node.js binaries matching the system architecture (development/production) is crucial to avoid such issues.

I was debugging for 2 hours and found this. This helped me, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants