代码之家  ›  专栏  ›  技术社区  ›  programmer

zip不支持1980年aws之前的时间戳

  •  4
  • programmer  · 技术社区  · 8 年前

    我们正在使用aws codestar创建项目。这些都很好用。但从今天起,我们面临以下问题:

    无法上载GetCompanyRecords资源的CodeUri参数引用的项目None。

    zip不支持1980年之前的时间戳

    现在,当我再次删除aws sdk模块时,它运行良好。但当我再次添加它时,构建失败了。我对此非常担心。这是我的lambda函数。

    GetCompanyRecords:
    Type: AWS::Serverless::Function
    Properties:
      Handler: index.handler
      Runtime: nodejs6.10
      Role:
        Fn::ImportValue:
          !Join ['-', [!Ref 'ProjectId', !Ref 'AWS::Region', 'LambdaTrustRole']]
      Timeout: 10
      Events:
        PostEvent:
          Type: Api
          Properties:
            Path: /getCompanyRecords
            Method: post
    

    提前感谢

    2 回复  |  直到 6 年前
        1
  •  2
  •   programmer    8 年前

    此时,以下补丁修复了我的问题:

    我在buildspec中添加了以下行。“npm安装”后的yml

    -ls$CODEBUILD\u SRC\u目录

    -查找$CODEBUILD\u SRC\u DIR/node\u modules-mtime+10950-exec touch{};

    由于我在添加aws sdk时遇到了问题,所以我希望aws能够解决这个问题。我真的很失望aws sdk没有与aws一起工作。。

        2
  •  1
  •   sapy    7 年前

    您忘记了用git初始化代码库:)。这意味着它试图从git的头部创建zip,但失败了

    rm -rf .git
    git init
    git add .
    git commit -am 'First commit'