Building for macOS-x86_64 but attempting to link with file built for macOS-arm64 on mac m1

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Hey there, I don't see issues page, but i saw this PR about mac m1.
      I use Mac m1 12.0.1 monterey, and node@14.17.0 | darwin | x64.

      I successfully installed mongodb-client-encryption npm package. Now when i try to run my index.js where i require('mongodb-client-encryption"), it gives me following error in the terminal.

      Error: dlopen(/Users/ray/Desktop/crypt/cryptpad/database/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node, 0x0001): tried: '/Users/ray/Desktop/crypt/cryptpad/database/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/lib/mongocrypt.node' (no such file)

      When i tried to rebuild inside node_modules, env BUILD_TYPE="dynamic" npx node-gyp rebuild, it throws:

      Anyone knows how to resolve ? I followed the README of _https://github.com/mongodb/libmongocrypt/_ repo, but still same issue on mac M1

            Assignee:
            Unassigned
            Reporter:
            Anon Decen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: