yarnpkg/yarn

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

Open

#5,955 建立於 2018年6月8日

在 GitHub 查看
 (8 留言) (0 反應) (1 負責人)JavaScript (41,514 star) (2,731 fork)batch import
cat-buggood first issuehelp wanted

描述

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

貢獻者指南

yarn upgrade-interactive fails with Invalid version: undefined error if a dependency has only prerelease versions · yarnpkg/yarn#5955 | Good First Issue