invoke local cannot find module

Created a sample repository

It works on AWS Lambda consoles

It does not work in a local environment

[my-service]$ npx sls invoke local -f hello                                                                                                                           ![main]
Error: Cannot find module 'moment'
Require stack:
- /Users/gouda/PhpstormProjects/serverless-framework-sample/my-service/handler.js
- /Users/gouda/PhpstormProjects/serverless-framework-sample/node_modules/serverless/lib/plugins/aws/invokeLocal/index.js
- /Users/gouda/PhpstormProjects/serverless-framework-sample/node_modules/serverless/lib/plugins/index.js
- /Users/gouda/PhpstormProjects/serverless-framework-sample/node_modules/serverless/lib/classes/PluginManager.js
- /Users/gouda/PhpstormProjects/serverless-framework-sample/node_modules/serverless/lib/Serverless.js
- /Users/gouda/PhpstormProjects/serverless-framework-sample/node_modules/serverless/scripts/serverless.js
- /Users/gouda/PhpstormProjects/serverless-framework-sample/node_modules/serverless/bin/serverless.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:772:15)
    at Function.Module._load (internal/modules/cjs/loader.js:677:27)
    at Module.require (internal/modules/cjs/loader.js:830:19)
    at require (internal/modules/cjs/helpers.js:68:18)
    at Object.<anonymous> (/Users/gouda/PhpstormProjects/serverless-framework-sample/my-service/handler.js:1:1)
    at Module._compile (internal/modules/cjs/loader.js:936:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
    at Module.load (internal/modules/cjs/loader.js:790:32)
    at Function.Module._load (internal/modules/cjs/loader.js:703:12)
    at Module.require (internal/modules/cjs/loader.js:830:19)
    at require (internal/modules/cjs/helpers.js:68:18)
    at AwsInvokeLocal.invokeLocalNodeJs (/Users/gouda/PhpstormProjects/serverless-framework-sample/node_modules/serverless/lib/plugins/aws/invokeLocal/index.js:763:33)
    at AwsInvokeLocal.invokeLocal (/Users/gouda/PhpstormProjects/serverless-framework-sample/node_modules/serverless/lib/plugins/aws/invokeLocal/index.js:230:19)
    at Object.invoke:local:invoke [as hook] (/Users/gouda/PhpstormProjects/serverless-framework-sample/node_modules/serverless/lib/plugins/aws/invokeLocal/index.js:49:47)
    at PluginManager.invoke (/Users/gouda/PhpstormProjects/serverless-framework-sample/node_modules/serverless/lib/classes/PluginManager.js:576:20)
    at async PluginManager.run (/Users/gouda/PhpstormProjects/serverless-framework-sample/node_modules/serverless/lib/classes/PluginManager.js:634:7)
    at async Serverless.run (/Users/gouda/PhpstormProjects/serverless-framework-sample/node_modules/serverless/lib/Serverless.js:327:5)
    at async /Users/gouda/PhpstormProjects/serverless-framework-sample/node_modules/serverless/scripts/serverless.js:704:9 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/gouda/PhpstormProjects/serverless-framework-sample/my-service/handler.js',
    '/Users/gouda/PhpstormProjects/serverless-framework-sample/node_modules/serverless/lib/plugins/aws/invokeLocal/index.js',
    '/Users/gouda/PhpstormProjects/serverless-framework-sample/node_modules/serverless/lib/plugins/index.js',
    '/Users/gouda/PhpstormProjects/serverless-framework-sample/node_modules/serverless/lib/classes/PluginManager.js',
    '/Users/gouda/PhpstormProjects/serverless-framework-sample/node_modules/serverless/lib/Serverless.js',
    '/Users/gouda/PhpstormProjects/serverless-framework-sample/node_modules/serverless/scripts/serverless.js',
    '/Users/gouda/PhpstormProjects/serverless-framework-sample/node_modules/serverless/bin/serverless.js'
  ]
}
 
 Serverless Error ----------------------------------------
 
  Exception encountered when loading /Users/gouda/PhpstormProjects/serverless-framework-sample/my-service/handler
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              12.9.0
     Framework Version:         2.43.1 (local)
     Plugin Version:            5.1.4
     SDK Version:               4.2.2
     Components Version:        3.10.1

I would suggest checking to see if an existing issue exists or creating a new one in the Serverless Framework GitHub issues list: Issues · serverless/serverless · GitHub