I made project with create-next-app. And I downgrade next version to 12. After then, I installed some modules that I need with yarn. I set some module's version such as typescript, react, and so on. In this process, I maybe installed @typescript-eslint/parser with yarn script 'yarn install @typescript/parser@^5.62.0'. So in my package.json, @typescript/parser is written as '"5.62.0' version.
But whenever I try to run 'yarn install' after git pull, this error is printed.
yarn install v1.22.19
info No lockfile found.
[1/4] 🔍 Resolving packages...
warning @types/react-query@1.2.9: This is a stub types definition. react-query provides its own type definitions, so you do not need this installed.
[2/4] 🚚 Fetching packages...
error @typescript-eslint/parser@6.10.0: The engine "node" is incompatible with this module. Expected version "^16.0.0 || >=18.0.0". Got "14.21.2"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
that said I should upgrade node version because of @typescript-eslint/parser's version is 6.10.0. But in my package.json like this↓
If I upgrade node version 16.14.0 using nvm, it works well.
But I don't understand why my @typescript-eslint/parser's version is different from package.json.
First of all, I thought it is caused by other depending module's version. But other project which is has almost similar module and version is run well by node v14.21.2. That project has almost same package.json to mine because I considered module's version referring to that.
What should I check if I want to know why @typescript-eslint/parser@6.10.0 is shown my script ?
Thank you !
You need to import once again project and use correct version of Node from beginning. When You start installing project "yarn install" with wrong version of Node.JS its very difficult to update/downgrade dependencies to work together. All deps are set one time during first install and after this, the remembered version of dependencie is different (higher) than defined in project.