Site deploy fails unless Netlify’s build cache is cleared. I looked at the 5 points mentioned in [Common Issue]: My site deploy fails unless Netlify's build cache is cleared. I don’t think points 1, 3, 4 , 5 relate to my issue and so from a process of elimination it looks like it may be point 2:
Your dependencies have binary components, which need to be rebuilt for some reason. For instance, if the version of Node.js we use to build changes, any binary modules built against the old version are unlikely to work with the new version - BUT we also may not rebuild them if they are cached already!
Things I tried:
- migrating our build image to xenial. The error is still the same.
- modfiying the build command from
GENERATE_ENV_JS=1 yarn buildto
rm -rf $NETLIFY_CACHE_DIR/* && GENERATE_ENV_JS=1 yarn buildbut then the log threw
yarn: command not foundwhich is even more confusing. I did that in this commit. The netlify log can be found here.
Here’s an example of a build log not working unless it is cleared and retried: https://app.netlify.com/sites/taskcluster-web/deploys/5e95e709426a1500075ef965
It looks like it’s having trouble with installing a library so probably an issue with the node_modules directory. If that could be the issue, what would be the best way to delete node_modules from the cache?
Context: The issue showed up after updating some of our dependencies in
ui/package.json of the repo.