Skip to content

Commit 1a72e99

Browse files
authored
fix: fix vue add/invoke bug when user does not have yarn installed (#3806)
closes #3804
1 parent e8bc36d commit 1a72e99

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/@vue/cli-ui/apollo-server/util/command.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ exports.getCommand = function (cwd = undefined) {
1010
if (!cwd) {
1111
return loadOptions().packageManager || (hasYarn() ? 'yarn' : hasPnpm3OrLater() ? 'pnpm' : 'npm')
1212
}
13-
return hasProjectYarn(cwd) ? 'yarn' : hasProjectPnpm() ? 'pnpm' : 'npm'
13+
return hasProjectYarn(cwd) ? 'yarn' : hasProjectPnpm(cwd) ? 'pnpm' : 'npm'
1414
}

packages/@vue/cli/lib/add.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async function add (pluginName, options = {}, context = process.cwd()) {
2727
log(`📦 Installing ${chalk.cyan(packageName)}...`)
2828
log()
2929

30-
const packageManager = loadOptions().packageManager || (hasProjectYarn(context) ? 'yarn' : hasProjectPnpm() ? 'pnpm' : 'npm')
30+
const packageManager = loadOptions().packageManager || (hasProjectYarn(context) ? 'yarn' : hasProjectPnpm(context) ? 'pnpm' : 'npm')
3131
await installPackage(context, packageManager, options.registry, packageName)
3232

3333
log(`${chalk.green('✔')} Successfully installed plugin: ${chalk.cyan(packageName)}`)

packages/@vue/cli/lib/invoke.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ async function runGenerator (context, plugin, pkg = getPkg(context)) {
145145
log(`📦 Installing additional dependencies...`)
146146
log()
147147
const packageManager =
148-
loadOptions().packageManager || (hasProjectYarn(context) ? 'yarn' : hasProjectPnpm() ? 'pnpm' : 'npm')
148+
loadOptions().packageManager || (hasProjectYarn(context) ? 'yarn' : hasProjectPnpm(context) ? 'pnpm' : 'npm')
149149
await installDeps(context, packageManager, plugin.options && plugin.options.registry)
150150
}
151151

0 commit comments

Comments
 (0)