Error message in nodejs
[nodemon] starting node server.js
Error: Error: DPI-1047: Cannot locate a 64-bit Oracle Client library: "dlopen(/Users/pitidev-ldb/Downloads/instantclient_19_8/libclntsh.dylib, 0x0001): tried: '/Users/pitidev-ldb/Downloads/instantclient_19_8/libclntsh.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/Users/pitidev-ldb/Downloads/instantclient_19_8/libclntsh.dylib.19.1' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))". See https://oracle.github.io/node-oracledb/INSTALL.html for help
Asked
Active
Viewed 827 times
3

PitiDev
- 45
- 5
-
3Because there is no M1 port of the Oracle client libraries, you will need to use the Intel x86_64 Node.js binary with Oracle's macOS Intel Instant Client libraries. Apple's Rosetta with then kick in. – Christopher Jones Sep 16 '22 at 22:25
-
1pls recommend me what how to – PitiDev Sep 20 '22 at 05:48
1 Answers
2
I had the same problem and got things to work.
To install Node, Terminal needs to be run using Rosetta during installation. NVM will pick the specified version number as usual but opt for the x86_64 binaries instead of M1.
Installed
nvm
according to NVMs own siteFollowed this stack overflow post. What worked for me (read details in the post if things don't work out for you)
- Make terminal/iTerm2 to open in Rosetta mode. Got to
Applications (-> utilities) -> right click on terminal app -> get Info -> Select "Open using Rosetta" -> Restart Terminal
- In Terminal.app run
arch -x86_64 zsh
- From here install the Node version you need according to the NVM docs. I simply used
nvm install node
to install the latest version. - You can reverse step 1 and run the Terminal app without Rosetta support.
- Make terminal/iTerm2 to open in Rosetta mode. Got to
You should now be able to run Node with the x86_64 version. (no matter if Terminal is run using Rosetta or not)

tobi-or-not
- 566
- 4
- 13