gpt4 book ai didi

amazon-web-services - 找不到无服务器插件 “serverless-offline”。确保它已安装并列在无服务器配置文件的 “plugins”部分中

转载 作者:行者123 更新时间:2023-12-03 13:48:24 25 4
gpt4 key购买 nike

部署SLS项目时,出现以下错误:

Serverless plugin "serverless-offline" not found. Make sure it's installed and listed in the "plugins" section of your serverless config file



但是我确实正确安装了 serverless-offline插件,请有人帮我修复它。

这是我的 serverless.yml文件:
   service: email-sender

provider:
name: aws
runtime: nodejs4.3

functions:
send:
handler: handler.send
events:
- http:
path: submissions
method: post
response:
headers:
Content-Type: "text/json"
cors:
origins:
- '*'
package:
exclude:
- node_modules/**
include:
- node_modules/serverless-offline/**

plugins:
- serverless-offline

最佳答案

无服务器脱机是仅在您的开发计算机上而不是生产环境中运行的插件。

要启用它,请将以下内容添加到serverless.yml:

    plugins:
- serverless-offline

并删除以下几行
      include:
- node_modules/serverless-offline/**

还要检查您的 package.json并确保它是 devDependencies

关于amazon-web-services - 找不到无服务器插件 “serverless-offline”。确保它已安装并列在无服务器配置文件的 “plugins”部分中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46302742/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com