Yarn: Yarn check fails when version is prefixed with a 'v'

Created on 30 Jun 2017  路  3Comments  路  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?
bug

What is the current behavior?
yarn check fails when version is prefixed with a 'v'.

If the current behavior is a bug, please provide the steps to reproduce.
https://github.com/jeffrey-xiao/yarn-check-error-repro

yarn
yarn check

What is the expected behavior?
Should not error.

Please mention your node.js, yarn and operating system version.
[email protected]
[email protected]
[email protected]

This doesn't seem to be an issue with [email protected] though.

good first issue help wanted triaged

Most helpful comment

We investigated a bit with @Timpetricola and found the following:

I'm not familiar at all witht he codebase but maybe using semver.satisfies instead of !== would fix it ?

cheers

All 3 comments

There is a package that sanitizes version.
Feel free to send a PR to use it in the check.js command.

We investigated a bit with @Timpetricola and found the following:

I'm not familiar at all witht he codebase but maybe using semver.satisfies instead of !== would fix it ?

cheers

Thanks, @Intrepidd and @TimPetricola.
I see the strict check pkg.version !== packageJson.version was there before but maybe something else moved.

I would suggest calling semver.clean on the version from package.json.
Would you guys send a PR please?

Was this page helpful?
0 / 5 - 0 ratings