1

I am trying to deploy my react app on cloudflare pages and getting this error while building with yarn.

error got@12.1.0: The engine "node" is incompatible with this module. Expected version ">=14.16". Got "12.18.0" error Found incompatible module. info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. Error during Yarn install Failed: build command exited with code: 1 Failed: error occurred while running build command

The build is successful in my local, I am using node version v16.15.0 It seems like cloudflare is using lower node version 12 by default.

  • Does this answer your question? [The engine "node" is incompatible with this module. Expected version "12.x". Got "14.8.0"](https://stackoverflow.com/questions/66429081/the-engine-node-is-incompatible-with-this-module-expected-version-12-x-got) – tripleee Apr 25 '23 at 07:55

1 Answers1

1

The required node version for your application is greater than 14.16 as specified by the error statement. As of 25 April 2023, Cloudflare has default Node version as Node.js 12.18.0

We can change the node version by setting the ENVIRONMENT VARIABLE during the build process.

Setting NODE_VERSION = 16.15.0 will solve the issue.