Report this

What is the reason for this report?

What should I do when Error code: BuildJobExitNonZero shows up?

Posted on October 23, 2020

As I was following through the tutorial how to Deploy and Build Laravel apps(https://www.youtube.com/watch?v=QnNA7YdvCYA) I ran into a deployment problem on Error code: BuildJobExitNonZero. The logs says :

portfolio | 10:16:55 ---> No file to start server
portfolio | 10:16:55 ---> either use 'docker run' to start container or add index.js or server.js
portfolio | 10:16:55 Installing node_modules using npm
portfolio | 10:16:56 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.
portfolio | 10:16:56 
portfolio | 10:16:56 npm ERR! A complete log of this run can be found in:
portfolio | 10:16:56 npm ERR!     /home/apps/.npm/_logs/2020-10-23T03_16_56_989Z-debug.log
portfolio | 10:16:57 unable to invoke layer creator
portfolio | 10:16:57 installing node_modules: exit status 1
portfolio | 10:16:57 ERROR: failed to build: exit status 1
portfolio | 10:16:57  ! Build failed (exit code 7)


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

@eliabrian69 👋

Thanks for using the App Platform! The important error in the output you posted is:

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.

This is saying that you should run npm install (or yarn install) and commit the package-lock.json or yarn.lock file, that’s generated by those commands, with your code. That should resolve the issue and allow the build to continue.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.