Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/40.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 无服务器1.65.0的部署返回错误ECONREFUNCED 127.0.0.1:4567_Node.js_Serverless Framework_Serverless_Localstack - Fatal编程技术网

Node.js 无服务器1.65.0的部署返回错误ECONREFUNCED 127.0.0.1:4567

Node.js 无服务器1.65.0的部署返回错误ECONREFUNCED 127.0.0.1:4567,node.js,serverless-framework,serverless,localstack,Node.js,Serverless Framework,Serverless,Localstack,自从更新到serverless的最新版本(1.65.0)后,我在部署到Localstack后收到一条错误消息 Serverless: config.options_stage: development Serverless: serverless.service.custom.stage: undefined Serverless: serverless.service.provider.stage: ${opt:stage, 'development'} Serverless: config.

自从更新到serverless的最新版本(1.65.0)后,我在部署到Localstack后收到一条错误消息

Serverless: config.options_stage: development
Serverless: serverless.service.custom.stage: undefined
Serverless: serverless.service.provider.stage: ${opt:stage, 'development'}
Serverless: config.stage: development
Serverless: Using serverless-localstack
Serverless: Reconfiguring service apigateway to use http://localhost:4567
Serverless: Reconfiguring service cloudformation to use http://localhost:4581
Serverless: Reconfiguring service cloudwatch to use http://localhost:4582
Serverless: Reconfiguring service lambda to use http://localhost:4574
Serverless: Reconfiguring service dynamodb to use http://localhost:4569
Serverless: Reconfiguring service kinesis to use http://localhost:4568
Serverless: Reconfiguring service route53 to use http://localhost:4580
Serverless: Reconfiguring service firehose to use http://localhost:4573
Serverless: Reconfiguring service stepfunctions to use http://localhost:4585
Serverless: Reconfiguring service es to use http://localhost:4578
Serverless: Reconfiguring service s3 to use http://localhost:4572
Serverless: Reconfiguring service ses to use http://localhost:4579
Serverless: Reconfiguring service sns to use http://localhost:4575
Serverless: Reconfiguring service sqs to use http://localhost:4576
Serverless: Reconfiguring service sts to use http://localhost:4592
Serverless: Reconfiguring service iam to use http://localhost:4593
Serverless: Reconfiguring service ssm to use http://localhost:4583
Serverless: Reconfiguring service rds to use http://localhost:4594
Serverless: Reconfiguring service ec2 to use http://localhost:4597
Serverless: Reconfiguring service elasticache to use http://localhost:4598
Serverless: Reconfiguring service kms to use http://localhost:4599
Serverless: Reconfiguring service secretsmanager to use http://localhost:4584
Serverless: Reconfiguring service logs to use http://localhost:4586
Serverless: Reconfiguring service cloudwatchlogs to use http://localhost:4586
Serverless: Reconfiguring service iot to use http://localhost:4589
Serverless: Reconfiguring service cognito-idp to use http://localhost:4590
Serverless: Reconfiguring service cognito-identity to use http://localhost:4591
Serverless: Reconfiguring service ecs to use http://localhost:4601
Serverless: Reconfiguring service eks to use http://localhost:4602
Serverless: Reconfiguring service xray to use http://localhost:4603
Serverless: Reconfiguring service appsync to use http://localhost:4605
Serverless: Reconfiguring service cloudfront to use http://localhost:4606
Serverless: Reconfiguring service athena to use http://localhost:4607
Serverless: Warning: Unable to find plugin named: TypeScriptPlugin
Serverless: config.options_stage: development
Serverless: serverless.service.custom.stage: undefined
Serverless: serverless.service.provider.stage: development
Serverless: config.stage: development
Serverless: config.options_stage: development
Serverless: serverless.service.custom.stage: undefined
Serverless: serverless.service.provider.stage: development
Serverless: config.stage: development
Serverless: Using deployment bucket 'shift-planner-asyncjobs'
Serverless: Compiling with Typescript...
Serverless: Using local tsconfig.json
Serverless: Typescript compiled.
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Service files not changed. Skipping deployment...
Service Information
service: shift-planner-asyncjobs
stage: development
region: eu-west-1
stack: shift-planner-asyncjobs-development
resources: 5
api keys:
  None
endpoints:
  None
functions:
  shiftPublishedEmails: shift-planner-asyncjobs-development-shiftPublishedEmails
layers:
  None

Stack Outputs
ServerlessDeploymentBucketName: shift-planner-asyncjobs
ShiftPublishedEmailsLambdaFunctionQualifiedArn: ShiftPublishedEmailsLambdaVersionFBinxqNcQ4hoU4l1I0378dVUKpD30oJdG3FSg4Xf0

Serverless: Recoverable error occurred (connect ECONNREFUSED 127.0.0.1:4567), sleeping for ~6 seconds. Try 1 of 4
Serverless: Recoverable error occurred (connect ECONNREFUSED 127.0.0.1:4567), sleeping for ~7 seconds. Try 2 of 4
Serverless: Recoverable error occurred (connect ECONNREFUSED 127.0.0.1:4567), sleeping for ~4 seconds. Try 3 of 4
Serverless: Recoverable error occurred (connect ECONNREFUSED 127.0.0.1:4567), sleeping for ~7 seconds. Try 4 of 4

  Serverless Error ---------------------------------------

  connect ECONNREFUSED 127.0.0.1:4567

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              12.16.1
     Framework Version:         1.65.0
     Plugin Version:            3.4.1
     SDK Version:               2.3.0
     Components Version:        2.22.3

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! shift-planner-asyncjobs@0.1.0 deploy-localstack: `node --max-old-space-size=4096 node_modules/serverless/bin/serverless --stage development deploy --verbose`
npm ERR! Exit status 1

以下是无服务器文件:


service:
  name: shift-planner-asyncjobs

plugins:
  - serverless-deployment-bucket
  - serverless-localstack
  - serverless-plugin-typescript
  - serverless-offline

provider:
  name: aws
  runtime: nodejs12.x
  region: 'eu-west-1'
  stage: ${opt:stage, 'development'}
  memorySize: 512
  deploymentBucket:
    name: shift-planner-asyncjobs
    serverSideEncryption: AES256
  tracing:
    apiGateway: true
    lambda: true
  environment:
    ENV: ${self:provider.stage, 'development'}
    REGION: 'eu-west-1'

custom:
  localstack:
    stages:
      - development
    debug: true
    host: 'http://localhost'

functions:
  publishedEmails:
    handler: handler.someHandler
    events:
      - sqs:
          arn:
            Fn::Join:
              - ':'
              - - arn
                - aws
                - sqs
                - Ref: AWS::Region
                - Ref: AWS::AccountId
                - queueName

我比较了两个版本的日志,似乎在版本1.65.0中我缺少这一部分:


Serverless: Using custom endpoint for S3: http://localhost:4572
Serverless: Using custom endpoint for CloudFormation: http://localhost:4581
Serverless: Using custom endpoint for S3: http://localhost:4572
Serverless: Using custom endpoint for S3: http://localhost:4572
Serverless: Using custom endpoint for Lambda: http://localhost:4574
Serverless: Using custom endpoint for STS: http://localhost:4592
Serverless: Uploading CloudFormation file to S3...
Serverless: Using custom endpoint for S3: http://localhost:4572
Serverless: Uploading artifacts...
Serverless: Uploading service shift-planner-asyncjobs.zip file to S3 (7.57 MB)...
Serverless: Using custom endpoint for S3: http://localhost:4572
Serverless: Validating template...
Serverless: Skipping template validation: Unsupported in Localstack
Serverless: Creating Stack...
Serverless: Using custom endpoint for CloudFormation: http://localhost:4581
Serverless: Overriding S3 templateUrl to http://localhost:4572
Serverless: Checking Stack create progress...
Serverless: Using custom endpoint for CloudFormation: http://localhost:4581
CloudFormation - CREATE_COMPLETE - AWS::CloudFormation::Stack - shift-planner-asyncjobs-development
Serverless: Stack create finished...
Serverless: Using custom endpoint for CloudFormation: http://localhost:4581
Serverless: Using custom endpoint for CloudFormation: http://localhost:4581

在检查repo中的代码后,我注意到大多数日志来自函数“interceptRequest(service,method,params)”

lambda函数按预期工作,但每次部署后,此错误消息会不断弹出。 在此之前,我使用的是无服务器1.53.0,一切都很顺利