How to fix "VipsJpeg: Premature end of JPEG file" for Gatsby + Contentful + Netlify
![How to fix "VipsJpeg: Premature end of JPEG file" for Gatsby + Contentful + Netlify](/content/images/size/w1200/2020/02/gatsby-contentful-netlify.jpg)
My Gatsby website was running and building correctly in my local but when Netlify started the deployment, the build failed because the following error
VipsJpeg: Premature end of JPEG file
This is the full log of the error
![](https://sectorgeek.com/content/images/2020/02/VipsJpeg-Premature-end-of-JPEG-file.png)
I did some research to troubleshoot an issue, but I couldn't find a specific fix. Although my code wasn't generating any errors, I noticed a significant difference between Netlify and my local environment: Netlify was using NodeJS version v10.19.0, while my local environment was using v8.16.2. To resolve the issue, I created an .nvmrc file in the root of my project, specifying the NodeJS version I was using (v8.16.2) and pushed it to Netlify. This fixed the problem.