I am deploying my application at staging server. But it is failing during deployment and showing this error.
remote: -----> Building dependencies
remote: Installing node modules (package.json + package-lock)
remote: Unhandled rejection Error: Command failed: /usr/bin/git checkout 4.0
remote: error: pathspec ‘4.0’ did not match any file(s) known to git.
remote:
remote: at ChildProcess.exithandler (child_process.js:276:12)
remote: at emitTwo (events.js:126:13)
remote: at ChildProcess.emit (events.js:214:7)
remote: at maybeClose (internal/child_process.js:915:16)
remote: at Socket.stream.socket.on (internal/child_process.js:336:11)
remote: at emitOne (events.js:116:13)
remote: at Socket.emit (events.js:211:7)
remote: at Pipe._handle.close [as _onclose] (net.js:561:12)
remote: npm ERR! write after end
remote: npm ERR! write after end
remote: npm ERR! write after end
remote: npm ERR! write after end
remote: npm ERR! write after end
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.eZko6/_logs/2018-11-14T02_34_09_121Z-debug.log
remote:
remote: -----> Build failed
remote:
remote: We’re sorry this build is failing! You can troubleshoot common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote: If you’re stuck, please submit a ticket so we can help:
remote: https://help.heroku.com/
remote:
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy…
remote:
remote: ! Push rejected to drbeen-stage.
remote:
To https://heroku:ca3eaeab-23c3-40a2-947f-82bb98e68276@git.heroku.com/drbeen-stage.git
! [remote rejected] master -> master (pre-receive hook declined)
It looks like you don’t have a tag or branch called 4.0 as you expect. Please supply your config.yml in a formatted block so that readers stand a reasonable chance of being able to help - it is unlikely people can assist otherwise.
You may also need to explain how your deployment works e.g. whether you are using an ssh command, or a remote heroku command, etc.
Their solution was to disable cache of the .git folder before the checkout (to speedup checkout).
I’m sure it work but the checkout time can be long on some projects and their is no --depth configuration for git to save some data transfer.
True, but the checkout command is optional - you can just use git if you are willing to do the checkout manually, which in turn will allow you to do a shallow clone.