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:
execute yarn --ignore-engines from How to ignore incompatible engine "node" error on installing npm dependencies with yarn?
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
add "engine": { "node": ">=12.13.0"} to package.json from The engine "node" is incompatible with this module
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
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. ;)
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With