I am getting error while running serverless offline, even though I have the route folder present in my local. “Error: Cannot find module ‘C:\Workspace\service\routes\v1\authnRoutes’”, Below is the error that I am getting when I hit authn API in local
Tried below steps : rm -rf node_modules package-lock.json npm cache clean --force npm install No luck same error
Serverless: POST /v1/authn (λ: authn)
Serverless: Error while loading authn
[
"Error: Cannot find module 'C:\\Workspace\\service\\routes\\v1\\authnRoutes'",
'Require stack:',
'- C:\\Workspace\\service\\node_modules\\serverless-offline\\src\\functionHelper.js',
'- C:\\Workspace\\service\\node_modules\\serverless-offline\\src\\createAuthScheme.js',
'- C:\\Workspace\\service\\node_modules\\serverless-offline\\src\\index.js',
'- C:\\Workspace\\service\\node_modules\\serverless\\lib\\classes\\PluginManager.js',
'- C:\\Workspace\\service\\node_modules\\serverless\\lib\\Serverless.js',
'- C:\\Users\\test\\AppData\\Roaming\\npm\\node_modules\\serverless\\lib\\Serverless.js',
'- C:\\Users\\test\\AppData\\Roaming\\npm\\node_modules\\serverless\\scripts\\serverless.js',
'- C:\\Users\\test\\AppData\\Roaming\\npm\\node_modules\\serverless\\bin\\serverless.js',
'at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)',
'at Function.Module._load (internal/modules/cjs/loader.js:725:27)',
'at Module.require (internal/modules/cjs/loader.js:952:19)',
'at require (internal/modules/cjs/helpers.js:88:18)',
'at Object.createHandler (C:\\Workspace\\service\\node_modules\\serverless-offline\\src\\functionHelper.js:114:21)',
'at handler (C:\\Workspace\\service\\node_modules\\serverless-offline\\src\\index.js:564:40)',
'at Object.internals.handler (C:\\Workspace\\service\\node_modules\\hapi\\lib\\handler.js:101:51)',
'at C:\\Workspace\\service\\node_modules\\hapi\\lib\\handler.js:32:23',
'at module.exports.internals.Protect.internals.Protect.run (C:\\Workspace\\service\\node_modules\\hapi\\lib\\protect.js:60:12)',
'at exports.execute (C:\\Workspace\\service\\node_modules\\hapi\\lib\\handler.js:26:22)',
'at each (C:\\Workspace\\service\\node_modules\\hapi\\lib\\request.js:401:16)',
'at iterate (C:\\Workspace\\service\\node_modules\\items\\lib\\index.js:36:13)',
'at done (C:\\Workspace\\service\\node_modules\\items\\lib\\index.js:28:25)',
'at internals.Auth.payload (C:\\Workspace\\service\\node_modules\\hapi\\lib\\auth.js:235:16)',
'at each (C:\\Workspace\\service\\node_modules\\hapi\\lib\\request.js:401:16)',
'at iterate (C:\\Workspace\\service\\node_modules\\items\\lib\\index.js:36:13)',
'at done (C:\\Workspace\\service\\node_modules\\items\\lib\\index.js:28:25)',
'at onParsed (C:\\Workspace\\service\\node_modules\\hapi\\lib\\route.js:341:20)',
'at C:\\Workspace\\service\\node_modules\\hapi\\lib\\route.js:380:20',
'at next (C:\\Workspace\\service\\node_modules\\subtext\\lib\\index.js:46:26)',
'at C:\\Workspace\\service\\node_modules\\subtext\\lib\\index.js:243:16',
'at finish (C:\\Workspace\\service\\node_modules\\wreck\\lib\\index.js:374:20)',
'at wrapped (C:\\Workspace\\service\\node_modules\\wreck\\node_modules\\hoek\\lib\\index.js:879:20)',
'at module.exports.internals.Recorder.onReaderFinish (C:\\Workspace\\service\\node_modules\\wreck\\lib\\index.js:449:16)',
'at Object.onceWrapper (events.js:421:28)',
'at module.exports.internals.Recorder.emit (events.js:327:22)',
'at module.exports.internals.Recorder.EventEmitter.emit (domain.js:529:15)',
'at finish (internal/streams/writable.js:657:10)'
]
Serverless: Replying error in handler
"errorMessage": "Error while loading authn",
"errorType": "Error",
"stackTrace": [
"Error: Cannot find module 'C:\\Workspace\\service\\routes\\v1\\authnRoutes'",
"Require stack:",
"- C:\\Workspace\\service\\node_modules\\serverless-offline\\src\\functionHelper.js",
"- C:\\Workspace\\service\\node_modules\\serverless-offline\\src\\createAuthScheme.js",
"- C:\\Workspace\\service\\node_modules\\serverless-offline\\src\\index.js",
"- C:\\Workspace\\service\\node_modules\\serverless\\lib\\classes\\PluginManager.js",
"- C:\\Workspace\\service\\node_modules\\serverless\\lib\\Serverless.js",
"- C:\\Users\\test\\AppData\\Roaming\\npm\\node_modules\\serverless\\lib\\Serverless.js",