From 448dbdb4f3213cba178fb6181d379e80ffaa30f6 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Tue, 23 Jul 2019 20:35:05 +0800 Subject: [PATCH] fix: use `yarn --version` to detect yarn (#4336) - We never referred to `yarnpkg` anywhere else in the codebase - For the rare case that `yarn` binary is overridden by Hadoop YARN, `yarn --version` will throw (it only supports `yarn version`), therefore it won't pass this check. Fixes #3941. Closes #3942. --- packages/@vue/cli-shared-utils/lib/env.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@vue/cli-shared-utils/lib/env.js b/packages/@vue/cli-shared-utils/lib/env.js index 7e3eef15e..506ce35ec 100644 --- a/packages/@vue/cli-shared-utils/lib/env.js +++ b/packages/@vue/cli-shared-utils/lib/env.js @@ -24,7 +24,7 @@ exports.hasYarn = () => { return _hasYarn } try { - execSync('yarnpkg --version', { stdio: 'ignore' }) + execSync('yarn --version', { stdio: 'ignore' }) return (_hasYarn = true) } catch (e) { return (_hasYarn = false)