# MODULE\_NOT\_FOUND error when attempting to invoke my Lambda function locally

**URL:** https://forum.serverless.com/t/module-not-found-error-when-attempting-to-invoke-my-lambda-function-locally/6281
**Category:** Serverless Framework
**Created:** [October 28, 2018, 9:18am UTC](https://forum.serverless.com/t/module-not-found-error-when-attempting-to-invoke-my-lambda-function-locally/6281 "2018-10-28T09:18:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![matthewcummings](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/matthewcummings/32/2692_2.png) [@matthewcummings](https://forum.serverless.com/u/matthewcummings)
#### Post date: [October 28, 2018, 9:18am UTC](https://forum.serverless.com/t/module-not-found-error-when-attempting-to-invoke-my-lambda-function-locally/6281/1 "2018-10-28T09:18:39Z")

</div>

Not sure what the issue is yet. . . I’m using hapi and typescript and taking some code which runs locally via npm scripts and trying to port it over to Serverless. I suspect there are one or more silly issues here, but I don’t get much debug output.

When I run invoke locally, I get this:  
Error: Exception encountered when loading /home/matthew/repos/pin/office-365-addin-backend  
at AwsInvokeLocal.invokeLocalNodeJs (/home/matthew/repos/pin/office-365-addin-backend/node\_modules/serverless/lib/plugins/aws/invokeLocal/index.js:272:13)  
at AwsInvokeLocal.invokeLocal (/home/matthew/repos/pin/office-365-addin-backend/node\_modules/serverless/lib/plugins/aws/invokeLocal/index.js:125:19)  
From previous event:  
at Object.invoke:local:invoke [as hook] (/home/matthew/repos/pin/office-365-addin-backend/node\_modules/serverless/lib/plugins/aws/invokeLocal/index.js:26:10)  
at BbPromise.reduce (/home/matthew/repos/pin/office-365-addin-backend/node\_modules/serverless/lib/classes/PluginManager.js:390:55)  
From previous event:  
at PluginManager.invoke (/home/matthew/repos/pin/office-365-addin-backend/node\_modules/serverless/lib/classes/PluginManager.js:390:22)  
at PluginManager.run (/home/matthew/repos/pin/office-365-addin-backend/node\_modules/serverless/lib/classes/PluginManager.js:421:17)  
at variables.populateService.then.then (/home/matthew/repos/pin/office-365-addin-backend/node\_modules/serverless/lib/Serverless.js:157:33)  
at runCallback (timers.js:810:20)  
at tryOnImmediate (timers.js:768:5)  
at processImmediate [as \_immediateCallback] (timers.js:745:5)  
From previous event:  
at Serverless.run (/home/matthew/repos/pin/office-365-addin-backend/node\_modules/serverless/lib/Serverless.js:144:8)  
at serverless.init.then (/home/matthew/repos/pin/office-365-addin backend/node\_modules/serverless/bin/serverless:43:50)  
at

Any helps is appreciated.
