简体   繁体   中英

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.

[Container] 2021/06/14 12:44:52 Running command 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. then try again.

Looks like you'll need to generate the package-lock.json so that the command can succeed. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM