How to do (npm install --force) in next build?

Viewed 22

I'm trying to build a next project that some of its dependencies are not compatible apparently. The below errors show up:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: eslint-plugin-react-hooks@2.5.1
npm ERR! Found: eslint@7.31.0
npm ERR! node_modules/eslint
   dev eslint@"^7.12.1" from the root project
npm ERR!   peer eslint@"^5.0.0 || ^6.0.0 || ^7.0.0" from @typescript-eslint/eslint-plugin@4.28.5
npm ERR!   node_modules/@typescript-eslint/eslint-plugin
npm ERR!     dev @typescript-eslint/eslint-plugin@"^4.0.0" from the root project
npm ERR!     peer @typescript-eslint/eslint-plugin@"^4.4.1" from eslint-config-airbnb-typescript@12.0.0
npm ERR!     node_modules/eslint-config-airbnb-typescript
npm ERR!       dev eslint-config-airbnb-typescript@"12.0.0" from the root project
npm ERR!   9 more (@typescript-eslint/experimental-utils, ...)
npm ERR! 
 Could not resolve dependency:
npm ERR! peer eslint@"^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0" from eslint-plugin-react-hooks@2.5.1
npm ERR! node_modules/eslint-plugin-react-hooks
npm ERR!   dev eslint-plugin-react-hooks@"^2.3.0" from the root project
npm ERR!   peer eslint-plugin-react-hooks@"^4 || ^3 || ^2.3.0 || ^1.7.0" from eslint-config-airbnb@18.2.0
npm ERR!   node_modules/eslint-config-airbnb
npm ERR!     eslint-config-airbnb@"18.2.0" from eslint-config-airbnb-typescript@12.0.0
npm ERR!     node_modules/eslint-config-airbnb-typescript
 ERR!       dev eslint-config-airbnb-typescript@"12.0.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: eslint@6.8.0
npm ERR! node_modules/eslint
npm ERR!   peer eslint@"^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0" from eslint-plugin-react-hooks@2.5.1
npm ERR!   node_modules/eslint-plugin-react-hooks
npm ERR!     dev eslint-plugin-react-hooks@"^2.3.0" from the root project
npm ERR!     peer eslint-plugin-react-hooks@"^4 || ^3 || ^2.3.0 || ^1.7.0" from eslint-config-airbnb@18.2.0
     node_modules/eslint-config-airbnb
npm ERR!       eslint-config-airbnb@"18.2.0" from eslint-config-airbnb-typescript@12.0.0
npm ERR!       node_modules/eslint-config-airbnb-typescript
npm ERR!         dev eslint-config-airbnb-typescript@"12.0.0" 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
 to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /root/.npm/eresolve-report.txt for a full report.

I want to ignore these errors and go on with the possibly broken dependencies (as in npm install --force) but I'm not sure how I can to this with next build. (I've tried next build --force and it doesn't work.)

0 Answers
Related