Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install all unmet dependencies in yarn

There's error in my react app, it says:

    Line 0:  Parsing error: Cannot find module 'eslint-scope' from '/home/path/.cache/yarn/v6/npm-eslint-7.11.0-aaf2d23a0b5f1d652a08edacea0c19f7fadc0b3b-integrity/node_modules/eslint/lib/api.js'

Then I add eslint-scope to my dependencies with the following command:

    yarn add eslint-scope

But I found so much, unmet peer dependencies:

    warning " > @testing-library/[email protected]" has unmet peer dependency "@testing-library/dom@>=7.21.4".
    warning " > [email protected]" has unmet peer dependency "@typescript-eslint/eslint-plugin@^4.0.0".
    warning " > [email protected]" has unmet peer dependency "@typescript-eslint/parser@^4.0.0".
    warning " > [email protected]" has unmet peer dependency "babel-eslint@^10.0.0".
    warning " > [email protected]" has unmet peer dependency "eslint-plugin-flowtype@^5.2.0".
    warning " > [email protected]" has unmet peer dependency "eslint-plugin-import@^2.22.0".
    warning " > [email protected]" has unmet peer dependency "eslint-plugin-jsx-a11y@^6.3.1".
    warning " > [email protected]" has unmet peer dependency "eslint-plugin-react@^7.20.3".
    warning " > [email protected]" has unmet peer dependency "eslint-plugin-react-hooks@^4.0.8".

When I tried install one of those, I found another unmet dependencies:

    warning " > @testing-library/[email protected]" has unmet peer dependency "@testing-library/dom@>=7.21.4".
    warning " > [email protected]" has unmet peer dependency "@typescript-eslint/eslint-plugin@^4.0.0".
    warning " > [email protected]" has unmet peer dependency "@typescript-eslint/parser@^4.0.0".
    warning " > [email protected]" has unmet peer dependency "eslint-plugin-flowtype@^5.2.0".
    warning " > [email protected]" has unmet peer dependency "eslint-plugin-import@^2.22.0".
    warning " > [email protected]" has unmet peer dependency "eslint-plugin-jsx-a11y@^6.3.1".
    warning " > [email protected]" has unmet peer dependency "eslint-plugin-react@^7.20.3".
    warning " > [email protected]" has unmet peer dependency "eslint-plugin-react-hooks@^4.0.8".

can I install all of the unmeet dependencies automatically?

like image 669
Roby Cigar Avatar asked Oct 26 '20 18:10

Roby Cigar


Video Answer


1 Answers

First of all you should try to find out why eslint-scope is needed by running this command yarn why eslint-scope.

If you still think it's needed then you should know that peer dependencies by default are not installed anymore. You can read more about it here. In NPM V7 peerDependencies are installed automatically again.

For now you should try using the install-peerdeps package npx install-peerdeps -Y eslint-scope

like image 168
Nikhil Verma Avatar answered Oct 25 '22 12:10

Nikhil Verma