cancel
Showing results for 
Search instead for 
Did you mean: 

Getting error while installing hana-client

Hi,

I am getting the following error on Mac OS when trying to install hana-client. Please let me know how to resolve this error?

dlopen(/Users/XXXX/Documents/XXXX/node_modules/@sap/hana-client/prebuilt/darwinintel64-xcode7/hana-client.node, 0x0001): tried: '/Users/XXXX/Documents/XXXX/node_modules/@sap/hana-client/prebuilt/darwinintel64-xcode7/hana-client.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/hana-client.node' (no such file), '/usr/lib/hana-client.node' (no such file)

npm ERR! /Users/XXXXX/Documents/IC/acm-fp-admin/node_modules/@sap/hana-client/lib/index.js:525

npm ERR! db.__stopAllWork();

npm ERR! ^

npm ERR!

npm ERR! TypeError: Cannot read properties of null (reading '__stopAllWork')

npm ERR! at process.<anonymous> (/Users/XXXXX/Documents/XXXX/node_modules/@sap/hana-client/lib/index.js:525:8)

npm ERR! at process.emit (node:events:390:28)

npm ERR! at process.exit (node:internal/process/per_thread:184:15)

npm ERR! at Object.<anonymous> (/Users/XXXX/Documents/XXXX/node_modules/@sap/hana-client/checkbuild.js:21:13)

npm ERR! at Module._compile (node:internal/modules/cjs/loader:1101:14)

npm ERR! at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)

npm ERR! at Module.load (node:internal/modules/cjs/loader:981:32)

npm ERR! at Function.Module._load (node:internal/modules/cjs/loader:822:12)

npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)

npm ERR! at node:internal/main/run_main_module:17:47

Accepted Solutions (1)

Accepted Solutions (1)

jeff_albion
Employee
Employee

Hello,

The 2.14.18 HANA Client has now been released (now on npm) with this support.

Best regards,

Jeff

former_member850439
Discoverer
0 Kudos

Hi Jeff,

I am still facing error: " node_modules/@sap/hana-client/prebuilt/darwinarm64-xcode12/libdbcapiHDB.dylib` is missing. " even with hana client version 2.14.18 with node version 18.15.0 on mac OS ventura 13.3.

jeff_albion
Employee
Employee
0 Kudos

Hi Vaibhav,

Is the file actually there on the file system, or no?

There is the HDB_NODEJS_INSTALL_PLATFORMS environment variable which can be used to restrict which platforms the driver is vendored for and thus the file may have been stripped out:
https://help.sap.com/docs/SAP_HANA_CLIENT/f1b440ded6144a54ada97ff95dac7adf/2dbfa39ecc364a65a6ab0fea9...

Otherwise if the file is there, check the file with the command:

ldd node_modules/@sap/hana-client/prebuilt/darwinarm64-xcode12/libdbcapiHDB.dylib

to see if there are any missing system dependencies.

Best regards,

Jeff

Answers (5)

Answers (5)

former_member245390
Discoverer

I had the same issue and unfortunately installing Rosetta 2 didn't do the trick. However, I found out that the problem was a wrong node version. When trying to install @sap/hana-client with node version 16.13.2 I faced the same issue as you did. But using an older version like 14.17.1 works.

I hope this helps.

0 Kudos

It worked for me as well, thank you 🙂

gsmithun4
Discoverer

Not working for me 😞

0 Kudos

This worked for me as well! Thanks a lot!

dvankempen
Product and Topic Expert
Product and Topic Expert

Hi ipshita.lahiri,

Curious, and thanks for sharing the note.

According to the log output it is the wrong binary

mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')

Note 2996882 mentions the ARM (M1) binary is planned but not yet available.

Software Downloads and the SAP Developers tool website confirms this is still the case.

According to Apple, the OS detects Intel apps and prompts to install Rosetta

In case this does not occur, you can install Rosetta manually

softwareupdate --install-rosetta

/usr/sbin/softwareupdate --install-rosetta --agree-to-license #alternative

Once installed, you can set the properties of a binary to run using Rosetta (if not configured automatically).

Answer's your question?

dewi_duval
Member

I had the same problem (occurred upon npm i) and could resolve as follows:

Install brew on intel architecture as described in https://github.com/Homebrew/discussions/discussions/2845

In case of access issues in the installation, this might help:
sudo chown -R "$USER":admin /usr/local

Check the architecture in shell :
arch

Check the running brew version:
which brew

This should be in usr/local for the intel version, if you get /opt/homebrew/bin/brew, this is the apple silicon version, did not work for me.

Install node 16 on Intel architecture:
arch -x86_64 brew install node@16

Make node known:
echo 'export PATH="/usr/local/opt/node@16/bin:$PATH"' >> ~/.zshrc

Optional: Set VS Code to run with rosetta

-> in finder search for code.app

-> command I

-> check option: open with rosetta

kosmopilot
Explorer

I resolved the problem by changing the version from "^2.11.20" to "~2.11.20" thus using the newest patch but not the newest minor version. It seems there's a problem with the latest minor version.

former_member850439
Discoverer
0 Kudos

Able to resolve it by

  • install Rosetta on mac
  • opening x86 based shell using rosetta
  • uninstalled previously installed node version
  • reinstalling the node(v18) from x86 based shell

after this npm install from rosetta x86 based shell would install @sap/hana-client succesfully