africandrogba
africandrogba

Reputation: 357

Unable to install npm package oracledb on M2 Mac even after installation of binaries

I am trying to install npm package oracledb version 5.1.0. However I am unable to install the package on my M2 Mac machine even after installing binaries.

I installed the basic(dmg) from https://www.oracle.com/database/technologies/instant-client/macos-arm64-downloads.html and followed the instructions to install it, I can the see the path is part of the bash_profile $PATH. However, I am still getting the error when running npm install

npm error oracledb ERR! NJS-067: a pre-built node-oracledb binary was not found for darwin arm64
npm error oracledb ERR! Try compiling node-oracledb source code using https://oracle.github.io/node-oracledb/INSTALL.html#github

I cannot install oracledb package version of 6 and above due to the issues in code it is causing. How can I rectify this ?

Upvotes: -1

Views: 74

Answers (1)

Christopher Jones
Christopher Jones

Reputation: 10721

See How to Install node-oracledb 5.5 and Oracle Database on Apple M1/M2 Silicon. But I have a feeling this may not work with newer versions of Node.js.

In summary, make sure your Node.js binary is for Intel.

$ brew install nvm
$ arch -x86_64 zsh
$ nvm install 16
$ npm install oracledb

And install Instant Client for Intel (not ARM):

$ cd $HOME/Downloads
$ curl -O https://download.oracle.com/otn_software/mac/instantclient/198000/instantclient-basic-macos.x64-19.8.0.0.0dbru.dmg
$ curl -O https://download.oracle.com/otn_software/mac/instantclient/198000/instantclient-sqlplus-macos.x64-19.8.0.0.0dbru.dmg
$ hdiutil mount instantclient-basic-macos.x64-19.8.0.0.0dbru.dmg
$ hdiutil mount instantclient-sqlplus-macos.x64-19.8.0.0.0dbru.dmg
$ /Volumes/instantclient-basic-macos.x64-19.8.0.0.0dbru/install_ic.sh
$ hdiutil unmount /Volumes/instantclient-basic-macos.x64-19.8.0.0.0dbru
$ hdiutil unmount /Volumes/instantclient-sqlplus-macos.x64-19.8.0.0.0dbru

Upvotes: 0

Related Questions