Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 无服务器部署找不到无服务器域管理器_Node.js_Amazon Web Services_Lambda_Deployment_Serverless - Fatal编程技术网

Node.js 无服务器部署找不到无服务器域管理器

Node.js 无服务器部署找不到无服务器域管理器,node.js,amazon-web-services,lambda,deployment,serverless,Node.js,Amazon Web Services,Lambda,Deployment,Serverless,我在AWS上使用bitbucket管道部署lambda时遇到以下错误 错误:无法设置基本路径映射。请先尝试运行sls创建\u域 错误:在api网关中找不到“staging api.simple.touchuite.com” ConfigError:配置中缺少区域 在getDomain.then.then.catch(/opt/atlassian/pipelines/agent/build/node_modules/serverless-domain-manager/index.js:181:15

我在AWS上使用bitbucket管道部署lambda时遇到以下错误

错误:无法设置基本路径映射。请先尝试运行sls创建\u域

错误:在api网关中找不到“staging api.simple.touchuite.com”

ConfigError:配置中缺少区域

在getDomain.then.then.catch(/opt/atlassian/pipelines/agent/build/node_modules/serverless-domain-manager/index.js:181:15)

在运行MicroTaskScallBack时(内部/进程/下一步_tick.js:121:5)
at_combinedTickCallback(内部/流程/下一步_tick.js:131:7)
在进程中。_tickDomainCallback(internal/process/next_tick.js:218:9)

对于调试日志,请在设置“SLS_DEBUG=*”环境变量后再次运行

获得支持
文档:Docs.serverless.com bug:github.com/serverless/serverless/issues 问题:forum.serverless.com

您的环境信息
操作系统:linux 节点版本:8.10.0
框架版本:1.61.3
插件版本:3.2.7
SDK版本:2.3.0
组件核心版本:1.1.2
组件CLI版本:1.4.0

因此,我将无服务器域管理器更新为最新版本3.3.1

在更新无服务器域管理器之后,我尝试部署lambda,现在出现以下错误

无服务器错误

找不到无服务器插件“无服务器域管理器”。确保它已安装并列在无服务器配置文件的“插件”部分

serverless.yml代码段

plugins:
  - serverless-plugin-warmup
  - serverless-offline
  - serverless-log-forwarding
  - serverless-domain-manager

custom:
  warmup:
    schedule: 'cron(0/10 12-23 ? * MON-FRI *)'
    prewarm: true
  headers:
    - Content-Type
    - X-Amz-Date
    - Authorization
    - X-Api-Key
    - X-Amz-Security-Token
    - TS-Staging
    - x-tss-correlation-id
    - x-tss-application-id

  stage: ${opt:stage, self:provider.stage}
  domains:
    prod: api.simple.touchsuite.com
    staging: staging-api.simple.touchsuite.com
    dev: dev-api.simple.touchsuite.com
  customDomain:
    basePath: 'svc'
    domainName: ${self:custom.domains.${self:custom.stage}}
    stage: ${self:custom.stage}
bitbucket-pipeline.yml代码段

image: node:8.10.0

pipelines:
  branches:
    master:
      - step:
          caches:
            - node
          name: Run tests
          script:
            - npm install --global copy
            - npm install
            - NODE_ENV=test npm test
      - step:
          caches:
            - node
          name: Deploy to Staging
          deployment: staging   # set to test, staging or production
          script:
            - npm install --global copy
            - npm run deploy:staging
            - npm run deploy:integrations:staging
            - node -e 'require("./scripts/bitbucket.js").triggerPipeline()'

需要了解一下,在创建Bitbucket错误时,我遗漏了什么?我需要添加一个
npm install
命令,以确保我的模块和插件在尝试运行之前都已安装。这可能是您的案例中缺少的内容。您还可以为生成的
node\u modules
文件夹打开缓存,这样它就不必在每次部署时下载所有模块。

我添加了bitbucket-pipeline.yml代码段。在升级无服务器域管理器之前,它工作正常,我无法找到无服务器域管理器。是否要确保插件已列在包中。json?我发现脚本无法仅使用npm install--global copy安装插件,我在管道的脚本部分添加了npm install,并正常工作。谢谢你的帮助