-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERR: undefined when installing eslint-config-airbnb #150
Comments
In other words, it should be grabbing the semver-latest from "^4 || ^3 || ^2.3.0 || ^1.7.0", but instead it's grabbing the "last" item. |
Thanks for this report! Right now the behavior is to grab the last item in the range: // Semver ranges can have a join of comparator sets
// e.g. '^3.0.2 || ^4.0.0' or '>=1.2.7 <1.3.0'
// Take the last version in the range
const rangeSplit = version.split(" ");
const versionToInstall = rangeSplit[rangeSplit.length - 1]; (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 const semverSort = require('semver/functions/sort');
// ...
const sortedRangeSplit = semverSort(rangeSplit);
const versionToInstall = sortedRangeSplit.pop(); 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 |
Okay so I looked more into it and there are several issues:
|
I think anything valid should be supported; the semver library works fine for that (stick to v6 for maximum back compat) it has a Range object and a bunch of useful methods. |
All right so this is my attempt to fix the issue, if anything is unclear or whatever let me know |
Still had the same issue with $PKG=package-name-here
$LOCAL_REGISTRY=https://my-local-registry.me
npx install-peerdeps --only-peers $PKG --registry $LOCAL_REGISTRY
npm install $PKG --registry $LOCAL_REGISTRY Not sure why it fails with |
When running
npx install-peerdeps --dev eslint-config-airbnb
I get the following error:Digging a bit more, I found the following log in my
~/.npm/_logs/
folder: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.xBug has already been reported to
eslint-config-airbnb
here: airbnb/javascript#2436The text was updated successfully, but these errors were encountered: