Amplify Console: while trigger a build
While building code using Amplify getting following error.
17 error 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. 18 verbose exit [ 1, true ] 2021-05-19T12:16:42.475Z [ERROR]: !!! Build failed 2021-05-19T12:16:42.475Z [ERROR]: !!! Non-Zero Exit Code detected 2021-05-19T12:16:42.475Z [INFO]: # Starting environment caching... 2021-05-19T12:16:42.475Z [INFO]: # Environment caching completed
Thanks!
+1
You can edit the Build file in Amplify and change the preBuild command to npm i instead of npm ci to get it working.
Or you can edit the template.yaml file to change the command as well.