queerviolet / bones

MIT License
36 stars 119 forks source link

Consider disabling node_modules cache for Heroku deployment #36

Closed glebec closed 7 years ago

glebec commented 7 years ago

See https://github.com/heroku/heroku-buildpack-nodejs/issues/380 for a more detailed explanation, but to summarize: Heroku's node buildpack uses yarn to install. Yarn currently has a bug wherein it doesn't do a proper integrity check as part of installation. As a result, if a devDep is changed to a dep by manually altering package.json, the deploy will mistakenly think it is still up to date, and anything relying on that dep will fail.

We can mitigate this temporarily (until yarn is fixed or the Heroku node buildpack implements a workaround) by disabling caching of the node_modules:

heroku config:set NODE_MODULES_CACHE=false

Thankfully this should still be faster than a vanilla npm install, as the yarn cache (not node_modules cache) will still be used.

I'm not sure if I want to bake this into the README at this point. I am hoping rather that the underlying issue can be fixed soon. Accordingly I'm not (yet) making a PR to change the deployment instructions.

glebec commented 7 years ago

This issue was moved to FullstackAcademy/bones#76