LeoMatei
LeoMatei

Reputation: 11

ESLint dependency fail

I want to use ESLint on a React project on VSCode, but it doesn't work. When I enter

npm install

it shows me this:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: type-fest@0.20.2
npm ERR! node_modules/type-fest
npm ERR!   type-fest@"^0.20.2" from globals@13.10.0
npm ERR!   node_modules/@eslint/eslintrc/node_modules/globals
npm ERR!     globals@"^13.9.0" from @eslint/eslintrc@0.4.3
npm ERR!     node_modules/@eslint/eslintrc
npm ERR!       @eslint/eslintrc@"^0.4.3" from eslint@7.32.0
npm ERR!       node_modules/eslint
npm ERR!         dev eslint@"^7.32.0" from the root project
npm ERR!         18 more (@typescript-eslint/eslint-plugin, ...)
npm ERR!   type-fest@"^0.20.2" from globals@13.10.0
npm ERR!   node_modules/eslint/node_modules/globals
npm ERR!     globals@"^13.6.0" from eslint@7.32.0
npm ERR!       dev eslint@"^7.32.0" from the root project
npm ERR!       18 more (@typescript-eslint/eslint-plugin, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional type-fest@"^0.13.1" from @pmmmwh/react-refresh-webpack-plugin@0.4.2
npm ERR! node_modules/@pmmmwh/react-refresh-webpack-plugin
npm ERR!   @pmmmwh/react-refresh-webpack-plugin@"0.4.2" from react-scripts@4.0.1
npm ERR!   node_modules/react-scripts
npm ERR!     react-scripts@"4.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Leo\AppData\Local\npm-cache\eresolve-report.txt for 
a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Leo\AppData\Local\npm-cache\_logs\2021-08-07T10_27_10_092Z-debug.log

Upvotes: 1

Views: 1620

Answers (1)

user16603402
user16603402

Reputation:

According to you log, npm install seems to have an issue with the type-fest dependency. You can try running npm install --save type-fest to save it to your dependencies, then retry.

Upvotes: 1

Related Questions