Netlify "build.command" failed for gatsby website
This kind of issue is related to mismatching versions of Node between your local environment and Netlify's one since all your packages are installed in node_modules
based on your Node version and Netlify's does the same so, there are a couple of things you can do to fix it:
-
Reverse your last changes of
package-lock.json
oryarn-lock.json
to get the previous working version. Once it's done, remove yournode_modules
folder and reinstall your dependencies again. -
Setting the same version of Node in both environments; you can use
node -v
locally to get your working version there (assuming that is building properly in your local machine) and manage the build dependencies to set the same version in Netlify's side. -
Force the manual upgrade of the dependencies by running:
yarn upgrade gatsby-plugin-manifest@latest gatsby-plugin-sharp@latest
-
Test the local environment by using
netlify-cli
will be helpful to check where the issue is located
Fix:
yarn upgrade gatsby-plugin-manifest@latest gatsby-plugin-sharp@latest
How I got here:
- Found a post on Netlify forums from the OP - Netlify states that this is related to the VIPS dependency, outside of Netlify's control.
- Found GH Issue on what's the issue for the VIPS dependency here.
- From those comments, see that the fix is to upgrade the two packages above.
P.S. I also tried changing/upgrading my Node version, as an answer suggested, but that didn't work.