Engine "node" not compatible with this module

Viewed 6406

I am having issues deploying recent changes made from a Gatsby project to Netlify. Start and build commands for the project locally works fine.

Here is the problem:

error gatsby@3.6.0: The engine "node" is incompatible with this module. Expected version ">=12.13.0". Got "10.24.1"

Here are links to the repo and deployment log:

https://github.com/simonxcode/simonxcode.com https://app.netlify.com/sites/simonxcode/deploys/60aeec1c22d2e5154232e488

I know this question has been asked numerous times before, but none of the common solutions worked for me. Perhaps I am executing them incorrectly or may be missing something else.

Here are the solutions that I have tried:

  1. execute yarn --ignore-engines from How to ignore incompatible engine "node" error on installing npm dependencies with yarn?

  2. set node variable in .env file (not visible in repo because .gitignore) from Setting Environment Variables for Node to retrieve

     //.env file
     NODE_ENV=development
    
  3. add "engine": { "node": ">=12.13.0"} to package.json from The engine "node" is incompatible with this module

  4. Update node with brew update and brew upgrade node from The engine "node" is incompatible with this module

    • Note 1: Before updating Homebrew, I deleted node_modules/ and yarn.lock files

    • Note 2: after executing brew postinstall node and brew link --overwrite node, I no longer have access to node, yarn or gatsby when checking with node -v, yarn -v and gatsby -v

3 Answers

As of 21 November 2021, if Expected version ">=14.15.0". Got "12.13.0". Simply update your Netlify environment variables with:

Key: NODE_VERSION Value: 14.15.0

It works fine for me.

I took care of this by using nvm. Nvm is the node version manager. I simply ran nvm install 12.13.0 and everything then worked fine.

Related