ERR: undefined when installing eslint-config-airbnb
See original GitHub issueWhen running npx install-peerdeps --dev eslint-config-airbnb
I get the following error:
install-peerdeps v3.0.3
Installing peerdeps for eslint-config-airbnb@latest.
npm install eslint-config-airbnb@18.2.1 eslint@^7.2.0 eslint-plugin-import@^2.22.1 eslint-plugin-jsx-a11y@^6.4.1 eslint-plugin-react@^7.21.5 eslint-plugin-react-hooks@^1.7.0 --save-dev
ERR undefined
Digging a bit more, I found the following log in my ~/.npm/_logs/
folder:
51 verbose node v16.1.0
52 verbose npm v7.16.0
53 error code ERESOLVE
54 error ERESOLVE unable to resolve dependency tree
55 error
56 error While resolving: solitaire@0.1.0
56 error Found: eslint@7.28.0
56 error node_modules/eslint
56 error dev eslint@"^7.2.0" from the root project
56 error peer eslint@"^5.16.0 || ^6.8.0 || ^7.2.0" from eslint-config-airbnb@18.2.1
56 error node_modules/eslint-config-airbnb
56 error dev eslint-config-airbnb@"18.2.1" from the root project
56 error 3 more (eslint-plugin-import, eslint-plugin-jsx-a11y, eslint-plugin-react)
56 error
56 error Could not resolve dependency:
56 error peer eslint@"^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0" from eslint-plugin-react-hooks@1.7.0
56 error node_modules/eslint-plugin-react-hooks
56 error dev eslint-plugin-react-hooks@"^1.7.0" from the root project
56 error peer eslint-plugin-react-hooks@"^4 || ^3 || ^2.3.0 || ^1.7.0" from eslint-config-airbnb@18.2.1
56 error node_modules/eslint-config-airbnb
56 error dev eslint-config-airbnb@"18.2.1" from the root project
56 error
56 error Fix the upstream dependency conflict, or retry
56 error this command with --force, or --legacy-peer-deps
56 error to accept an incorrect (and potentially broken) dependency resolution.
56 error
To me, it seems like install-peerdeps does not retrieve the correct version of eslint-plugin-react-hooks
- instead of getting the latest 4.x version, it gets the 1.7.0 version, which indeed does not support eslint 7.x
Bug has already been reported to eslint-config-airbnb
here: https://github.com/airbnb/javascript/issues/2436
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:6 (1 by maintainers)
Top Results From Across the Web
ERR undefined while installing airbnb eslint - Stack Overflow
First run npm info "eslint-config-airbnb@latest" peerDependencies to check the dependency versions · Use the versions for your own "npm install ...
Read more >[Solved]-ERR undefined while installing airbnb eslint-node.js
I resolved this by explicitly installing the dependent npm packages i.e. npm install [package]@[version] --save-dev rather than using the npx ...
Read more >eslint-config-airbnb - npm
This package provides Airbnb's .eslintrc as an extensible shared config. Usage. We export three ESLint configurations for your usage. eslint- ...
Read more >Airbnb JavaScript Style Guide()
It also assumes you are installing shims/polyfills in your app, ... 3.1 Use the literal syntax for object creation. eslint: no-new-object.
Read more >Linting React using Airbnb's ESLint Rules
npm install --save-dev eslint-config-airbnb. We now just need to tell ESLint that our own rules extend their Airbnb rules. This uses the Airbnb...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for this report! Right now the behavior is to grab the last item in the range:
(from https://github.com/nathanhleung/install-peerdeps/blob/master/src/install-peerdeps.js#L159)
It should be a few-line change to use semver’s
sort
function to sort therangeSplit
array and grab the latest version – code would look similar to below:If you are willing to take this change on + add some tests to verify it works, this can be a great first PR! Otherwise, I can look into this later this week.
Ah so that’s where the issue is, all right well it doesn’t look very complex, I’ll try to give it a go this week then