Skip to content

yarn upgrade-interactive fails with Invalid version: undefined error if a dependency has only prerelease versions #5955

@technicallyfeasible

Description

@technicallyfeasible

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.

  • add a dependency that does not have a "latest" tag (only prerelease versions published with tag "beta")
  • run yarn upgrade-interactive

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions