Add a Create Note API - Serverless invokation error

On the “Add a Create Note API” chapter,

When I type in
“serverless invoke local --function create --path mocks/create-event.json” onto the command line, I get the following error:

How do I fix this issue?
In addition, does the “response” appear on the command line, or is it sent to a different file?

The error message says you’re missing the serverless-offline plugin, so that’d be my first port of call. Your package.json file should include "serverless-offline" in the devDependencies section. If it doesn’t, run npm install serverless-offline --save-dev. If it does, delete your node_modules directory and run npm install, then try it again.

Good luck!

1 Like