Skip to content

Commit 6a75056

Browse files
committedJan 31, 2019
fix: should check yarn when no pacakage manager specified
(`shouldUseTaobao` is called without arguments in `getPackageVersion`) fixes #3393
1 parent fb71653 commit 6a75056

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎packages/@vue/cli/lib/util/shouldUseTaobao.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const chalk = require('chalk')
22
const execa = require('execa')
3-
const { request } = require('@vue/cli-shared-utils')
3+
const { hasYarn, request } = require('@vue/cli-shared-utils')
44
const inquirer = require('inquirer')
55
const registries = require('./registries')
66
const { loadOptions, saveOptions } = require('../options')
@@ -17,7 +17,11 @@ function removeSlash (url) {
1717
let checked
1818
let result
1919

20-
module.exports = async function shouldUseTaobao (command = 'npm') {
20+
module.exports = async function shouldUseTaobao (command) {
21+
if (!command) {
22+
command = hasYarn() ? 'yarn' : 'npm'
23+
}
24+
2125
// ensure this only gets called once.
2226
if (checked) return result
2327
checked = true

0 commit comments

Comments
 (0)
Please sign in to comment.