DB2 10.5 for Linux, UNIX, and Windows

Installing the node-ibm_db driver on Linux and UNIX systems

You can install the node-ibm_db driver on Linux and UNIX systems for use with Node.js applications.

Before you begin

You must install one of the listed IBM® data server products on the system where you are installing or running the Node.js application:
  • All supported versions, releases, and fix packs of the IBM Data Server Driver Package product
  • All Version 10.5 Fix Pack 4 or later IBM data server products

Procedure

To install the node-ibm_db driver:

  1. Set the IBM_DB_HOME environment variable to your IBM data server product installation directory by issuing the following command:
    export IBM_DB_HOME=DB2HOME
    where DB2HOME is the directory where the IBM data server product is installed. In a IBM Data Server Driver Package environment, DB2HOME is the directory in which the client package is installed. For example, if the client package is installed in the /home/db2inst1/dsdriver directory, issue the following command:
    export IBM_DB_HOME=/home/db2inst1/dsdriver
  2. Issue the npm install command:
    npm install ibm_db

What to do next

Before you run any Node.js application that connects to an IBM database server, you must ensure that the node-ibm_db driver can access the CLI driver by sourcing the db2profile script. The script is in the IBM data server product installation directory. To source the script, issue the following command:
source DB2HOME/db2profile