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.
This commit is contained in:
Haoqun Jiang
2019-07-23 20:35:05 +08:00
committed by GitHub
parent 00996ba7cf
commit 448dbdb4f3

View File

@@ -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)