I'm trying to execute a code node.js in IBM Cloud Functions, but I have an require that isn't pre-installed. Its the const {google} = require('googleapis') How can I install?
Asked
Active
Viewed 45 times
0
-
Looking at this article here, it looks like this guy uses `Webpack` to build his app before he uploads to IBM cloud: https://medium.com/@yunyuenchan/how-to-use-npm-module-in-ibm-cloud-functions-a0c76154e85 – Max Baldwin Sep 19 '18 at 19:22
1 Answers
0
Package the action as a zip file and include a node_modules
directory with external dependencies (googleapis
) needed.
Official documentation has more details about this approach: https://github.com/apache/incubator-openwhisk/blob/master/docs/actions-node.md#packaging-an-action-as-a-nodejs-module

James Thomas
- 4,303
- 1
- 20
- 26