Skip to content

Commit f162cb7

Browse files
committed
fix: package manager choices
1 parent 142fc52 commit f162cb7

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

packages/@vue/cli-shared-utils/lib/env.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ exports.hasGit = () => {
3737

3838
exports.hasPnpm = () => {
3939
if (process.env.VUE_CLI_TEST) {
40-
return false
40+
return true
4141
}
4242
if (_hasPnpm != null) {
4343
return _hasPnpm

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,7 @@ module.exports = class Creator extends EventEmitter {
390390
// ask for packageManager once
391391
const savedOptions = loadOptions()
392392
if (!savedOptions.packageManager && (hasYarn() || hasPnpm())) {
393-
const packageManagerChoices = [{
394-
name: 'Use NPM',
395-
value: 'npm',
396-
short: 'NPM'
397-
}]
393+
const packageManagerChoices = []
398394

399395
if (hasYarn()) {
400396
packageManagerChoices.push({
@@ -404,6 +400,12 @@ module.exports = class Creator extends EventEmitter {
404400
})
405401
}
406402

403+
packageManagerChoices.push({
404+
name: 'Use NPM',
405+
value: 'npm',
406+
short: 'NPM'
407+
})
408+
407409
if (hasPnpm()) {
408410
packageManagerChoices.push({
409411
name: 'Use PNPM',

0 commit comments

Comments
 (0)