Gatsby Build Error while deploying

Hello I’m running to this issue on Netlify when it’s executing the ‘Gatsby Build’ command, while on localhost everything is running smooth.

error Error in “/opt/build/repo/node_modules/gatsby-plugin-robots-txt/gatsby-node.js”: Cannot find module ‘fs/promises’

The image below shows the exact error area, kindly help.

Hi @JohnMunuve,

Could you share your site name?

The site name is 3techagency

Hey there, @JohnMunuve :wave:

I looked at your deploy log, and it looks like you’re using node v12.18.0. Can you try updating this to version 16? You can read more about that here: Build plugin update: System Node.js version upgrade to 16

If that still doesn’t work and you are using Gatsby, please try installing our plugin! You can read more about that here: Releases · netlify/netlify-plugin-gatsby · GitHub