uncletonton
uncletonton

Reputation: 13

IBM Cloud Functions: how to require "node-geocoder" in NodeJS

I´m trying to write an action in IBM Cloud Function that can take an address and change it to coordinate. The example in the picture is exactly wroten the same way as in "https://medium.com/javascript-in-plain-english/an-introduction-to-geocoding-using-node-js-fe1a5d3aa05c"

But I´m getting an error on IBM cloud function, that the module node-geocoder cannot be found. Is there any way to install that module in cloud function so that my code will work or this is not possible in IBM Cloud Function?

enter image description here

Upvotes: 0

Views: 228

Answers (1)

data_henrik
data_henrik

Reputation: 17176

There are different ways of how you could add the required node.js modules to the Cloud Functions environment. See the IBM Cloud Functions docs on Preparing JavaScript apps for details.

Use either webpack, package via npm and zip or deploy it as Docker container.

Upvotes: 0

Related Questions