-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
yarn upgrade-interactive fails with Invalid version: undefined error if a dependency has only prerelease versions #5955
Comments
Interesting. I'd never seen a package where the npm registry didn't return a |
this happened when we were using our own internal registry and had only published versions of some packages with a beta tag |
Can i try this one? Its my first time contributing to open source. |
@kpbl Sure! We appreciate the help! If you submit a PR, you should be able to mark me as a requested reviewer. Be sure to add a unit test too if you can. Thanks! 😸 |
I do not really know how to test this because i have no private registry. |
@rally25rs any tips? |
I believe to test this it should be possible to add a new package to the official npm registry which only has a "beta" tag defined and is a prerelease version. Not sure how this would work in a unit test though. |
Is this issue still solved or not |
Do you want to request a feature or report a bug?
A bug
What is the current behavior?
When running yarn upgrade-interactive and a dependency does not have a "latest" version then it fails with an error "Invalid version: undefined"
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
The command should run successfully and show the upgradeable versions of all packages.
If the package in question has a later prerelease version, that version should be suggested to be upgraded to.
Please mention your node.js, yarn and operating system version.
Arguments:
C:\Program Files (x86)\node\node.exe C:\Users\jens.elstner\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js upgrade-interactive
Yarn version:
1.7.0
Node version:
8.11.1
Platform:
win32 x64
Trace:
TypeError: Invalid Version: undefined
at new SemVer (C:\Users\jens.elstner\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:2465:11)
at SemVer.module.exports.SemVer.compare (C:\Users\jens.elstner\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:2528:13)
at compare (C:\Users\jens.elstner\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:2752:31)
at Function.lt (C:\Users\jens.elstner\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:2786:10)
at isDepOld (C:\Users\jens.elstner\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:36817:134)
at Array.filter ()
at Function. (C:\Users\jens.elstner\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:36822:19)
at Generator.next ()
at step (C:\Users\jens.elstner\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:98:30)
at C:\Users\jens.elstner\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:109:13
The text was updated successfully, but these errors were encountered: