How to use Node Modules in Cloud Functions

Hi All,

I’m trying to work with “files” in cloud-functions. Basically following this:

I’m creating the cloud function in the portal using the web IDE.

When I try and invoke the cloud function I’m getting the error:
“Error: Cannot find module ‘request-promise’”

Basically it seems to have an issue with the following line in the demo code.:
const request = require(‘request-promise’);

How do you install node modules in cloud functions?


Hi itheum,

Thanks for reporting this issue! You can use Files in Clode Code in the same was as in the Browser. The docs here were incorrect and have been updated. The “server side” in this context is NodeJs, not Cloud Code.

1 Like

How do I use Files here? do I upload all the required node modules?

for now it works if you upload in same cloud code also the code from the module, it doesn’t work with any module this way