I upgraded node on my local machine as well as migrated from create-react-app to nextjs.
When I pushed my code to AWS Amplify, I got this error:
error game-night@0.1.0: The engine "node" is incompatible with this module. Expected version ">=12.22.0". Got "12.21.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
I've looked on stackoveflow and other blogs and I've tried everything, but I still get this error.
My trials:
- Added engines: node to my package.json
"engines": {
"node": ">=12.22.0"
}
- Ran these commands:
sudo npm cache clean -f
sudo npm install -g n
- Double checked my node version:
node -v
v16.13.0
- Deleted and then installed the node modules folder with yarn install
Why is this error still occurring?