找到了一些解决方案,其中提到通过添加 --reloadHandler 它应该可以工作,但是在尝试命令时我收到以下消息:
serverless offline start --reloadHandler
Running "serverless" from node_modules
Initializing provider configuration...
Environment: darwin, node 16.19.0, framework 3.26.0 (local) 3.7.3v (global), plugin 6.2.2, SDK 4.3.2
Docs: docs.serverless.com
Support: forum.serverless.com
Bugs: github.com/serverless/serverless/issues
Error:
Detected unrecognized CLI options: "--reloadHandler".
您安装了“serverless-offline”软件包吗?
如果是这样,在我这边,我使用 package.json 与此
"scripts": {
"start": "serverless offline --reloadHandler"
}
命令
npm run start
就像一个魅力
这是我的无服务器版本:
"serverless": "3.38.0",
"serverless-offline": "13.3.2"