fix: don't try to install yarn 2 from npm (#7183)

as yarn 2 is local in the project and should be started by yarn 1 via yarn config file.
When using yarn2, installing latest yarn (v1) should work best

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
This commit is contained in:
Christophe Hurpeau 2020-09-07 08:49:40 +02:00 committed by GitHub
parent ee5e0ad162
commit ef3a79bdfe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,7 +53,7 @@ export async function generateLockFile(
!isValidYarnRange || minVersion(yarnCompatibility).major === 1;
let installYarn = 'npm i -g yarn';
if (isValidYarnRange) {
if (isYarn1 && isValidYarnRange) {
installYarn += `@${quote(yarnCompatibility)}`;
}