Skip to content

Commit

Permalink
Fix checking against non-semver compliant Yarn versions (#5362)
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer authored Oct 8, 2018
1 parent 9971653 commit f80d27b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/create-react-app/createReactApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,11 @@ function checkYarnVersion() {
yarnVersion = execSync('yarnpkg --version')
.toString()
.trim();
hasMinYarnPnp = semver.gte(yarnVersion, '1.12.0');
let trimmedYarnVersion = /^(.+?)[-+].+$/.exec(yarnVersion);
if (trimmedYarnVersion) {
trimmedYarnVersion = trimmedYarnVersion.pop();
}
hasMinYarnPnp = semver.gte(trimmedYarnVersion || yarnVersion, '1.12.0');
} catch (err) {
// ignore
}
Expand Down

0 comments on commit f80d27b

Please sign in to comment.