Skip to Content
Author's profile photo Tom Slee

Install the node.js driver for SAP HANA in under a minute

The node.js driver for SAP HANA is now publicly available directly from the SAP npm registry at https://npm.sap.com, under an SAP developer license agreement. You can install it in two lines using the npm node.js package manager. This is a short blog post for a quick install.

To install the node.js driver for SAP HANA, for a specific project:

# Change to the project directory
> cd {my project}
# Set the registry for @sap modules (be sure to type https, not http)
> npm config set @sap:registry https://npm.sap.com
# Install the HANA client
> npm install @sap/hana-client
# List the installed modules
> npm ls
# To update to the latest version
> npm update @sap/hana-client

To install the node.js driver for SAP HANA globally:

# Set the registry for @sap modules (be sure to type https, not http)
> npm config --global set @sap:registry https://npm.sap.com
# Install the HAN client
> npm install --global @sap/hana-client
# List the installed modules
> npm ls --global
# To update to the latest version
> npm update --global @sap/hana-client

If you are behind a proxy server, set your http_proxy and https_proxy environment variables, as you would for installing other node.js modules.

The install is available for Windows (x64), Mac OS, Linux (x64), and Linux on Power PC (little endian). The driver will be updated periodically with patches.

And that’s it… enjoy.

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo HP Seitz
      HP Seitz

      Hi Tom,

      thanks for this "announcement".

      Could you outline the relation of this new SAP scoped package @sap/hana-client to the existing hdb package "SAP HANA Database Client for Node" (https://github.com/SAP/node-hdb) on public npm registry?

      Currently other SAP scoped packages like @sap/xsjs or @sap/hdbext rely on the public hdb npm module. Will this change?

      The README of this package is very short. Is there any better documentation available?

      Thanks in advance, HP

       

      Author's profile photo Dilip Mamidela
      Dilip Mamidela

      Hi Tom,

      Yes the steps are easy.

      Thanks

      Dilip

       

      Author's profile photo Ajinkya Jadhav
      Ajinkya Jadhav

      Hi,

      We don't have npm installed in our OS system. How can we use it in our WebIDE project.

      Any suggesstions?

       

      Thank You.

      Regards,

      Ajinkya.

      Author's profile photo Tom Slee
      Tom Slee
      Blog Post Author

      Hi Ajinkya: if you are using WebIDE with a node.js buildpack, you will already have this driver present without taking any action. WebIDE provides an API above the driver itself that you will be using in development (I can't recall the module name right now).

      Author's profile photo Akhilesh Jain
      Akhilesh Jain

      Hi Tom,

       

      Can you also let us know how to install the .Net driver for SAP HANA? I am currently facing issue with installation of the same when I push my app to Cloud foundry.

       

      Cheers,

      Akhilesh

      Author's profile photo Tom Slee
      Tom Slee
      Blog Post Author

      Hi Akhilesh,

       

      If you are talking about Cloud Foundry (CF) then I guess you would need a Linux version of a .NET Core driver for HANA. Unfortunately that is not available yet. It is likely to be available in SPS05. If your customer has a Testing license then they may be able to get one earlier.

      I am not a CF expert. If you mean .NET driver (Windows) then maybe you can tell me more? Or ask a question at https://answers.sap.com/index.html, using the SAP HANA tag.

      Author's profile photo Luca Toldo
      Luca Toldo

      Dear colleagues,

      I want to create a Docker image of ubuntu:bionic with node and the hana libraries.

      FROM ubuntu:bionic
      RUN apt-get update -y  
      RUN apt-get install curl -y  
      RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - 
      RUN apt-get install nodejs -y 
      RUN npm install  @sap/hana-client
      
      When I execute that however I get the following error message:
      
      FATAL ERROR: A fatal error occurred during install.
      `/node_modules/@sap/hana-client/prebuilt/linuxppc64-gcc48/libdbcapiHDB.so` is missing. 
      
      Indeed, when I check in the distribution, there is a.
      linuxppc64le-gcc48 

      however not the required

      linuxppc64-gcc48
      
      can someone be of help ?
      Thankyou