How do you start aws-lambda-serverless-node-6 server locally?
What I tried
# Followed the quick start instructions at https://serverless.com/framework/docs/providers/aws/guide/quick-start/
$ npm install
npm WARN saveError ENOENT: no such file or directory, open '/Redacted/package.json'
$ node server
Error: Cannot find module '/Redacted/server'
My ls output
$ ls
handler.js package-lock.json serverless.yml
There are some steps in the tutorials that you skipped.
npm install
You don't have the file package.json in your working directory. That is why you have the warning:
npm WARN saveError ENOENT: no such file or directory, open '/Redacted/package.json'
node server
You want to launch the node server but you don't have the module server.js resulting in the error
Error: Cannot find module '/Redacted/server'.
According the documentation, you should first run:
npm install -g serverless
An then you follow correctly the appropriate steps to create your service or to deploy the server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With