1

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.

1
  • 1
    Did you include your node_modules into your deployment package? According to this guide, you must do so Commented Mar 19, 2019 at 11:00

1 Answer 1

2

You may need to install npm i dotenv --save

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.