Build fails on Heroku - "Appears to be a git repo or submodule."

I’m trying to deploy some updates I’ve made to to Heroku, but it’s failing with the following error:

-----> Node.js app detected


-----> Creating runtime environment







-----> Installing binaries

       engines.node (package.json):  6.11.x

       engines.npm (package.json):   unspecified (use default)


       Resolving node version 6.11.x...

       Downloading and installing node 6.11.5...

       Detected package-lock.json: defaulting npm to version 5.x.x

       Bootstrapping npm 5.x.x (replacing 3.10.10)...

       npm 5.x.x installed


-----> Restoring cache

       Cached directories were not restored due to a change in version of node, npm, yarn or stack

       Module installation may take longer for this build


-----> Building dependencies

       Installing node modules (package.json + package-lock)


       > dtrace-provider@0.8.7 install /tmp/build_7498120bb9dfd77d9bd6f124602951ad/node_modules/dtrace-provider

       > node-gyp rebuild || node suppress-error.js


       make: Entering directory '/tmp/build_7498120bb9dfd77d9bd6f124602951ad/node_modules/dtrace-provider/build'

         TOUCH Release/

       make: Leaving directory '/tmp/build_7498120bb9dfd77d9bd6f124602951ad/node_modules/dtrace-provider/build'


       > sqlite3@4.0.1 install /tmp/build_7498120bb9dfd77d9bd6f124602951ad/node_modules/sqlite3

       > node-pre-gyp install --fallback-to-build


       [sqlite3] Success: "/tmp/build_7498120bb9dfd77d9bd6f124602951ad/node_modules/sqlite3/lib/binding/node-v48-linux-x64/node_sqlite3.node" is installed via remote


       > sharp@0.20.7 install /tmp/build_7498120bb9dfd77d9bd6f124602951ad/node_modules/sharp

       > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)


       info sharp Downloading


       > jsonpath@1.0.0 postinstall /tmp/build_7498120bb9dfd77d9bd6f124602951ad/node_modules/jsonpath

       > node lib/aesprim.js > generated/aesprim-browser.js


       added 818 packages from 751 contributors in 46.081s


-----> Caching build

       - node_modules


-----> Pruning devDependencies

       npm ERR! path /tmp/build_7498120bb9dfd77d9bd6f124602951ad/node_modules/simply-godofredoninja

       npm ERR! code EISGIT

       npm ERR! git /tmp/build_7498120bb9dfd77d9bd6f124602951ad/node_modules/simply-godofredoninja: Appears to be a git repo or submodule.

       npm ERR! git     /tmp/build_7498120bb9dfd77d9bd6f124602951ad/node_modules/simply-godofredoninja

       npm ERR! git Refusing to remove it. Update manually,

       npm ERR! git or move it out of the way first.


       npm ERR! A complete log of this run can be found in:

       npm ERR!     /tmp/npmcache.wA3fp/_logs/2018-10-11T08_28_15_704Z-debug.log

-----> Build failed


       We're sorry this build is failing! You can troubleshoot common issues here:


       If you're stuck, please submit a ticket so we can help:





 !     Push rejected, failed to compile Node.js app.

 !     Push failed

Can anyone help me out? Thanks.

Googling that error led me here which suggests one of those packages (simply-godofredoninja) accidentally bundled its .git directory inside its release? Looks like that package released a new version recently – maybe try dropping back to an older version of it in your package.json file and see if that fixes it?

Is that possibly because it’s not actually a npm package?

I don’t fully understand it, but I think I’m pulling a bit of a hack to get the folder included, so I’m able to use it as a theme via some symlinks:

I’m able to make it work locally by starting with a blank slate, but because it doesn’t make any changes to the repo, it isn’t going to fix the deploy issue.

Hmm, no idea. The weird part is the error says it’s trying to prune devDependencies but your theme package is listed in dependencies… not sure why it’s trying to delete it in the first place!

If the committed .git folder made its way to deployment, can you SSH into the box and manually delete that folder?

If this was anything but Heroku, you probably could - but because of how Heroku works, there is no standard instance that you can just SSH into.

To be honest, I’m probably going to go back to DO hosting. The Ghost deployment strategy is totally different to what it used to be, and looks to be a lot more work to run on Heroku that I’m interested in investing.

1 Like

Have you tried running heroku run bash and have a look around? I cannot replicate as Im using Ghost 2 running on heroku without an issue. Though I’m not using

I installed locally, via npm, then pushed to heroku. No issues.

Proudly sponsored by Bytemark