Skip to content

Commit c5750fa

Browse files
committed
fix: fix vue create warning
1 parent 3774d25 commit c5750fa

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

bin/vue

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,6 @@ program
99
.command('init', 'generate a new project from a template')
1010
.command('list', 'list available official templates')
1111
.command('build', 'prototype a new project')
12-
13-
// output help information on unknown commands
14-
program
15-
.arguments('<command>')
16-
.action((cmd) => {
17-
console.log()
18-
console.log(` ` + chalk.red(`Unknown command ${chalk.yellow(cmd)}.`))
19-
if (cmd === 'create') {
20-
console.log(` ` + chalk.cyan(`vue create`) + ' is a Vue CLI 3 only command and you are using Vue CLI 2.x.')
21-
}
22-
console.log()
23-
})
12+
.command('create', '(for v3 warning only)')
2413

2514
program.parse(process.argv)

bin/vue-create

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env node
2+
3+
const chalk = require('chalk')
4+
5+
console.log()
6+
console.log(
7+
` ` +
8+
chalk.yellow(`vue create`) +
9+
' is a Vue CLI 3 only command and you are using Vue CLI ' +
10+
require('../package.json').version + '.'
11+
)
12+
console.log(` You may want to run the following to upgrade to Vue CLI 3:`)
13+
console.log()
14+
console.log(chalk.cyan(` npm uninstall -g vue-cli`))
15+
console.log(chalk.cyan(` npm install -g @vue/cli`))
16+
console.log()

0 commit comments

Comments
 (0)