Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Engine "node" not compatible with this module

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 [email protected]: 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

like image 368
simonxcode Avatar asked Apr 28 '26 11:04

simonxcode


2 Answers

I was able to resolve this issue by declaring Node version in Netlify's deployment setting. Build and Deploy environment variables were:

key: NODE_VERSION value: 12.13.0

Screenshot of Environment Variable

Here is more information regarding how to manage dependecies on Netlify.

https://docs.netlify.com/configure-builds/manage-dependencies/#node-js-and-javascript

Lastly, I ran into some other issues with current version of node(16.2.0), so will stick with 12.13.0 for now. ;)

like image 181
simonxcode Avatar answered May 01 '26 02:05

simonxcode


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.

like image 33
cyeehan Avatar answered May 01 '26 02:05

cyeehan