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


(Daniel Hollands) #1

I’m trying to deploy some updates I’ve made to https://github.com/LimeBlast/maker.limeblast.co.uk to Heroku, but it’s failing with the following error:

-----> Node.js app detected

       

-----> Creating runtime environment

       

       NPM_CONFIG_LOGLEVEL=error

       NODE_VERBOSE=false

       NODE_ENV=production

       NODE_MODULES_CACHE=true

       

-----> 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/obj.target/DTraceProviderStub.stamp

       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 https://github.com/lovell/sharp-libvips/releases/download/v8.6.1/libvips-8.6.1-linux-x64.tar.gz

       

       > 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:

       https://devcenter.heroku.com/articles/troubleshooting-node-deploys

       

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

       https://help.heroku.com/

       

       Love,

       Heroku

       

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

 !     Push failed

Can anyone help me out? Thanks.


(Matt Andrews) #2

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?


(Daniel Hollands) #3

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: https://github.com/LimeBlast/maker.limeblast.co.uk/tree/master/content/themes

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.


(Matt Andrews) #4

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!


(Jon) #5

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


(Daniel Hollands) #6

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.


(Daveyon Mayne) #7

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 https://github.com/cobyism/ghost-on-heroku

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