Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create-next-app fails nvm node 16 doesn't work

Trying to create a new next app with yarn create next-app. It fails with this error:

error @eslint/[email protected]: The engine "node" is incompatible with this module. Expected version "^12.22.0 || ^14.17.0 || >=16.0.0". Got "14.15.3"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Aborting installation.
  yarnpkg add --exact --cwd /Users/helenkent/Documents/Code/projects/lick-city-vote --dev eslint eslint-config-next has failed.

I upgraded my node version to 16, so when i check with node --version I get v16.13.1

When I tried to make the next app again I got the same error message as before, so its not seeing that I've upgraded node.

Don't really know what I'm doing when upgrading node so first I downloaded and clicked install on 16.13.1 from here https://nodejs.org/en/ but that didnt work when i checked the node version on the cmd line. Next I tried nvm install 16 and nvm use 16. That then showed node version 16.13.1 but like I said above, it still didn't help with the error as its somehow still picking up v14.15.3

Where did I go wrong?

like image 886
helen8297 Avatar asked Jul 20 '26 20:07

helen8297


1 Answers

  1. npm install -g npm@latest
  2. npm install node
  3. npm install -g yarn
  4. yarn cache clean
  5. npx create-next-app@latest

Try these steps, I was facing the same error and after searching for 1 hour I found this solution. Although it was for react app, it work for me. Here is the original solution. https://stackoverflow.com/a/58252362/11674006

like image 120
Javaid Avatar answered Jul 23 '26 14:07

Javaid



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!