简体   繁体   English

AWS CodeBuild:部署代码在管道中引发 npm 错误

[英]AWS CodeBuild: deploy the code throws npm error in pipeline

I am deploying the code build first time.我是第一次部署代码构建。 I am getting the below error when deploying the code in the server.在服务器中部署代码时出现以下错误。 The pipeline shows succeeded when code merged but when running npm ci in codebuild it throw an error.当代码合并时,管道显示成功,但在代码构建中运行 npm ci 时,它会抛出错误。

[Container] 2021/06/14 12:44:52 Running command npm ci npm ERR. [容器] 2021/06/14 12:44:52 运行命令 npm ci npm ERR。 cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVersion >= 1, Run an install with npm@5 or later to generate it. cipm 只能安装具有现有 package-lock.json 或 npm-shrinkwrap.json 且 lockfileVersion >= 1 的软件包,使用 npm@5 或更高版本运行安装以生成它。 then try again.然后再试一次。

Looks like you'll need to generate the package-lock.json so that the command can succeed.看起来您需要生成package-lock.json使命令成功。 See this answer for instructions on how to generate that file.Generate that file and check it into source code and then try re-running your build.有关如何生成该文件的说明,请参阅此答案。生成该文件并将其签入源代码,然后尝试重新运行您的构建。 As the error suggests, you'll need npm 5 or later although the answer I linked to is for npm 6 or 7.正如错误提示的那样,您需要 npm 5 或更高版本,尽管我链接到的答案是 npm 6 或 7。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AWS CodeBuild 中的 GetAuthorizationToken 权限错误 - GetAuthorizationToken permission error in AWS CodeBuild “npm run build”在 AWS CodeBuild 中失败但在本地成功 - 'npm run build' failed in AWS CodeBuild but succeeded locally 带有 Github 企业部署密钥的 AWS CodeBuild 要求输入密码 - AWS CodeBuild with Github Enterprise Deploy Keys asking for passphrase Terraform aws_codebuild_project 错误:InvalidInputException: - Terraform aws_codebuild_project error: InvalidInputException: 在 AWS CodeBuild 中运行容器时出现权限错误 - Permission Error Running Container in AWS CodeBuild AWS CDK 代码管道开发 - Typescript 错误 TS2307 - AWS CDK Code Pipeline Development - Typescript Error TS2307 AWS CDK 代码管道开发 - 错误 TS1005:预期为“]” - AWS CDK Code Pipeline Development - error TS1005: ']' expected 将 Github 存储库中的特定文件夹部署到 AWS Pipeline - Deploy specific folder in Github repository to AWS Pipeline 使用 CDK 的 AWS CodeBuild“错误:.git/HEAD 不存在” - AWS CodeBuild With the CDK "Error: .git/HEAD does not exist" AWS Copilot 管道失败,为什么 CodeBuild 找不到 buildspec.yml? - AWS Copilot pipeline fails, why cant CodeBuild find buildspec.yml?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM