We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
yyx990803
Learn more about funding links in repositories.
Report abuse
1 parent fb71653 commit 6a75056Copy full SHA for 6a75056
packages/@vue/cli/lib/util/shouldUseTaobao.js
@@ -1,6 +1,6 @@
1
const chalk = require('chalk')
2
const execa = require('execa')
3
-const { request } = require('@vue/cli-shared-utils')
+const { hasYarn, request } = require('@vue/cli-shared-utils')
4
const inquirer = require('inquirer')
5
const registries = require('./registries')
6
const { loadOptions, saveOptions } = require('../options')
@@ -17,7 +17,11 @@ function removeSlash (url) {
17
let checked
18
let result
19
20
-module.exports = async function shouldUseTaobao (command = 'npm') {
+module.exports = async function shouldUseTaobao (command) {
21
+ if (!command) {
22
+ command = hasYarn() ? 'yarn' : 'npm'
23
+ }
24
+
25
// ensure this only gets called once.
26
if (checked) return result
27
checked = true
0 commit comments