I have created a serverless boilerplate project using this command
sls create --template aws-nodejs-typescript --path my-project
I configured properly my AWS credantials thus I was able to depoly it successfully without any problem
sls deploy
But when I test de hello function I get the following error (after executing sls logs -f hello)
ERROR Uncaught Exception {"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot
find module 'handler'
Require stack:
-
/var/runtime/UserFunction.js
-
/var/runtime/index.js","stack":["Runtime.ImportModuleError: Error:
Cannot find module 'handler '","Require stack:","-
/var/runtime/UserFunction.js","- /var/runtime/index.js"," at
_loadUserApp (/var/runtime/UserFunction.js:100:13)"," at Object.module.ex ports.load (/var/runtime/UserFunction.js:140:17)","
at Object. (/var/runtime/index.js:43:30)"," at
Module._compile (internal/modules/cjs/loader.js :999:30)"," at
Object.Module._extensions..js
(internal/modules/cjs/loader.js:1027:10)"," at Module.load
(internal/modules/cjs/loader.js:863:32)"," at Func
tion.Module._load (internal/modules/cjs/loader.js:708:14)"," at
Function.executeUserEntryPoint [as runMain]
(internal/modules/run_main.js:60:12)"," at intern
al/main/run_main_module.js:17:47"]} END RequestId:
28588f41-1c4c-4391-82da-0c89bc1f9707 REPORT RequestId:
28588f41-1c4c-4391-82da-0c89bc1f9707 Duration: 164.91 ms Billed
Duration: 165 ms Memory Size: 1024 MB Max Memory Used: 15 MB
Unknown application error occurred Runtime.ImportModuleError
I think the problem is in the Windows environment, because when I deploy the service with Mac it works with no issue ! Did I need an extra-configuration to use Serverless with windows ? Thanks for any suggestion
question from:
https://stackoverflow.com/questions/65858124/issues-when-deploying-my-serverless-project-in-windows 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…