[英]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.