微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在打字稿中部署项目时,CodePipeline 中出现“无法上传工件”错误

如何解决在打字稿中部署项目时,CodePipeline 中出现“无法上传工件”错误

我正在将 lambda 项目从 javascript 迁移到打字稿,但 CodeBuild 步骤在部署中总是失败,我不明白是什么原因导致问题

这是我的构建规范:

version: 0.2
phases:
  install:
    commands:
      - apt-get update
      - npm i yarn -g
      - yarn --ignore-engines
      - find ./node_modules -mtime +10950 -exec touch {} +
      - rm -rf ./docs
  build:
    commands:
      - yarn compile:server
      - aws cloudformation package
        --template-file templates/samTemplate.yaml
        --s3-bucket ${CFN_BUCKET}
        --output-template-file templates/outputSamTemplate.yaml
artifacts:
  type: zip
  files:
    - '**/*'


Unable to upload artifact ./../ referenced by CodeUri parameter of MyLambda resource.
'ascii' codec can't decode byte 0xe6 in position 1: ordinal not in range(128)

这是我的 lambda 的 CloudFormation 部分:

  MyLambda:
    Type: AWS::Serverless::Function
    Properties:
      FunctionName: !Sub "lambda"
      Role: !GetAtt LambdaRole.Arn
      CodeUri: ./../
      Handler: dist/handler/lambda.lambda
      Runtime: nodejs12.x
      Timeout: 30

有人知道可能会发生什么吗?

解决方法

查看documentation。您的代码路径似乎格式不正确。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。