2

I have 2021 MacBook Pro M1 and I have nodes project where I am trying to use oracledb package and when I run I get the following error message:

Error: DPI-1047: Cannot locate a 64-bit Oracle Client library: "dlopen(/Users/.../mac_client/instantclient_19_8/libclntsh.dylib, 0x0001): tried: '/Users/.../mac_client/instantclient_19_8/libclntsh.dylib' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))". See https://oracle.github.io/node-oracledb/INSTALL.html for help

I have gone to the site and cannot find instructions on how to resolve my issue. I have also done several searches and have not found anything. I am just wondering if anyone in this community has run into this issue and how did you resolve it.

Any and all help is appreciated.

Christopher Jones
  • 9,449
  • 3
  • 24
  • 48
Joe
  • 743
  • 5
  • 10
  • 26
  • 1
    maybe this will help you https://blogs.oracle.com/opal/post/avoiding-the-dpi-1047-error-with-nodejs-node-oracledb-5-on-macos-and-windows – nbk Nov 16 '22 at 21:32
  • Thank you for the link to the article but I do have this code already in use. It's an issue with the Apple Silicon vs Intel. – Joe Nov 17 '22 at 13:47
  • if it doesn't help, write to the oracle support, they are competent and nice. – nbk Nov 17 '22 at 13:49
  • 2
    Apparently the trick is that you need to use Intel binary version of Node.js itself and then this can use the Intel Instant Client, all via Rosetta. There are some reports this can be done up to Node.js 14 but maybe there is a different solution for later versions. Check out the steps in https://gist.github.com/LeZuse/bf838718ff2689c5fc035c5a6825a11c – Christopher Jones Nov 17 '22 at 20:51
  • After a very long time to research, I succeeded. https://stackoverflow.com/questions/71882029/mach-o-file-but-is-an-incompatible-architecture-have-arm64-need-x86-64-i – Sơn Hoàng Feb 25 '23 at 20:12

1 Answers1

0

With node-oracledb 6.0 you no longer always need Oracle Instant Client - most apps will run without it. See the release announcement. A simple npm install oracledb should immediately lets your apps connect to Oracle Database.

If you do want to use some additional Oracle Database features currently only supported in the non-default 'Thick' mode with Instant Client, you'll currently need to use an Intel Node.js binary. See How to Install node-oracledb 5.5 and Oracle Database on Apple M1/M2 Silicon.

Christopher Jones
  • 9,449
  • 3
  • 24
  • 48