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