I’ve looked at the tutorials but I don’t understand. I have a function that processes stripe payments. I think it has something to do with packages.json but I can’t find information about where to put it or how to run it.
This is the code:
https://github.com/alexmacarthur/netlify-lambda-function-example/blob/master/lambda-src/purchase.js
With the important line simply being:
require('dotenv').config();
The error I get is:
{"errorMessage":"Cannot find module 'dotenv'"
How do I set about including this? Do I have to put a packages.json file in the same folder as my function? I tried that and it didn’t make any difference.
node_modulesinto your deployment package? According to this guide, you must do so