0

I got simple node.js code that works ok on my laptop. This testing nodejs application just selects a row from a Db2 database in IBM Cloud. However, when I integrated the code and deploy to IBM cloud, it complains "Error during initialization: { Error: Cannot find module 'connect:db2'( or ibm_db )".

I think that the environment in IBM Cloud does not have the ibm_db installed, My question is what are steps to install ibm_db to IBM Cloud to get the application (actually it is an action of a package in IBM Cloud) working?

data_henrik
  • 16,724
  • 2
  • 28
  • 49

1 Answers1

0

The ibm_db package is part of several runtimes of IBM Cloud Functions. For Node.js with Db2 I recommend to use the Node 8 or Node 10 runtimes. You need to specify the version when you create the action.

The solution tutorial on how to build a database-driven Slack chatbot uses Cloud Functions to access Db2. The code is written in Node.js and available on GitHub with instructions on how to deploy it. See the link.

data_henrik
  • 16,724
  • 2
  • 28
  • 49