Closed MadMaxMcKinney closed 4 years ago
Yes. This was working last week. It is breaking all of a sudden.
Node version: 8.15.1
Same.
Node version: 8.17.0
OS: ubuntu-xenial
Okay so I managed to fix my issue. This may fix y'alls issues as well @SaltyCatFish @AymanArif. If you are using a newer version of Gatsby (maybe v2+, not sure) then it doesn't support older versions of Node. I believe it's node 10.x and newer that is needed. You need to update the version of node that Netlify is using.
There are some instructions here for how to do that (there are a few different ways):
https://docs.netlify.com/configure-builds/manage-dependencies/#node-js-and-javascript
I used the method of making a .node-version
file in my root directory. In that file put only a single line with the version you want. I'm using the latest version: 12.18.2
. Put only that in the file. You'll see that it works in the Netlify console output during the build process.
This may show other errors as the newer versions of Gatsby has better error logging, so keep an eye out for that as well.
Additionally, if you don't want to create a new file in your workspace, you can just add an environment variable in your Netlify settings. The variable key must be NODE_VERSION
and the value must be a version number - 10.15.2
for example. 👍
I've been facing issues with Netlify and trying to build my site. I've had no issues for a solid year, then all of sudden I can't build. I decided to update my dependencies and now I'm getting an error in the gatsby package?
Error from Netlify:
My package.js
It builds locally just fine for me.
You can get the code here (under the develop branch): https://github.com/MaxMcKinney/max-mckinney-gatsby/tree/develop