Whelp! Can’t deploy a new Gatsby ,site becasue your node version is WAY outdated! Really? Please apply a patch? We can’t move forward! Missing in Focal image too.
error extract-files@11.0.0: The engine “node” is incompatible with this module. Expected version “^12.20 || >= 14.13”. Got “12.18.0”
You can specify a newer node version by adding an environment variable: Manage build dependencies | Netlify Docs
@hrishikesh I don’t understand why it would install 12.18.0 by default when the Focal docs specify that Node 16 should be installed by default
That’s indeed the version used for newly created websites, but upgrading a site to the newer version might lead to problems.
In Xenial, Node 12 was default, I believe. You make your app work perfectly with Node 12. Suddenly we upgrade the default to Node 16 and your app breaks because of all the breaking changes in 4 major versions. Instead, when upgrading build images, manually changing the Node Version is a better option in my personal opinion.
If not, you could always create a new website on Focal which would use Node 16 by default.
I am having the issue and this solution doesn’t work for me. What is odd is that I am deploying two other sites from the same mono repo and they are not encountering this issue. I have tried the solution of setting my NODE_ENV
environment variable to ^12.20 || >= 14.13
however the error doesn’t change which makes me think my site isn’t using it, I also have a netlify TOML file however this doesn’t include a NODE_ENV field
. Adding NODE_ENV = "^12.20 || >= 14.13"
to the netlify TOML also doesn’t’t change the node version in the error.
The error I am getting is:
6:47:43 PM: error extract-files@11.0.0: The engine "node" is incompatible with this module. Expected version "^12.20 || >= 14.13". Got "12.18.0"
6:47:43 PM: error Found incompatible module.
6:47:43 PM: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
6:47:43 PM: Error during Yarn install
6:47:43 PM: Build was terminated: Build script returned non-zero exit code: 1
6:47:43 PM: Creating deploy upload records
6:47:43 PM: Failing build: Failed to build site
6:47:43 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1
6:47:43 PM: Finished processing build request in 1m7.730799502s
Hey @jackow98,
Knowing the site name would help us debug this better.
You use this feature incorrectly (wrong/incorrect node env var usage). See example (netlify.toml)… Roll a 14 latest would be ideal. Mine is:
[context.production]
environment = { NODE_VERSION = '14.17.4' }
It probably does now… Did you try triggering a rebuild and dumping the cache? It shoud obey the newest install directives for Focal at that point otherwise it is skipping it.