The Blog of Rizal Renaldi

Rizal Renaldi

← Back

Nuxt build failed on Netlify

27 Sep 2022

dev

Sometimes my "rarely updated" website deployed on Netlify got build error when I tried to rebuild it again. I use Nuxt and the error message is mostly around "Nuxt fatal error", with various different details. This happens not once, but many times. I've tried to build the site on my local machine and it got successfully built with no error. I always had this suspicion that the error was caused by a different Node version, but never took a closer look into it. Turns out I was right.

image

So I just found out, in Netlify you can tell Netlify to use a different Node version. You can find it under the "build & deploy" setting > Environment, and set key NODE_VERSION with the value of any number of Node versions you want and write it without any dot. So if you want to use Node version 16.17.0, just put 16 in the value.

And guess what, no more error. Hfffttt.

The Blog of Rizal Renaldi

2024 © rizalrenaldi.com — Made with 🖖