Currently in the process of deploying my first Google Cloud function, the code for which can be found here:
https://github.com/rldaulton/GCF-Stripe/blob/master/Charge%20Customer/index.js
The code starts with the following line:
var app = require('express')();
var http = require('http').Server(app);
However, an error occurs when attempting to deploy with Node6 and execute the function named chargeCustomer:
Function failed on loading user code. Error message: Code in file index.js can't be loaded.
Did you list all required modules in the package.json dependencies?
Detailed stack trace: Error: Cannot find module 'express'
at Function.Module._resolveFilename (module.js:476:15)
at Function.Module._load (module.js:424:25)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/user_code/index.js:1:91)
at Module._compile (module.js:577:32)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
It appears that the express module is missing. How can I add this?