Check for Yarn instead of npm

This commit is contained in:
Fabio Berger
2018-04-24 10:43:44 +09:00
parent 04c07d9006
commit ffd9b79100

View File

@@ -132,13 +132,13 @@ async function checkPublishRequiredSetupAsync(): Promise<boolean> {
return false;
}
// Check NPM version is 5.X
const result = await execAsync(`npm --version`);
// Check Yarn version is 1.X
const result = await execAsync(`yarn --version`);
const version = result.stdout;
const versionSegments = version.split('.');
const majorVersion = _.parseInt(versionSegments[0]);
if (majorVersion < 5) {
utils.log('You npm version must be v5.x or higher. Upgrade your npm and try again.');
if (majorVersion < 1) {
utils.log('Your yarn version must be v1.x or higher. Upgrade yarn and try again.');
return false;
}