这是官网的原话,意思是如果你已经安装了vue-cli (1.x or 2.x)的版本,你需要先卸载后再安装
The package name changed from vue-cli to @vue/cli.
If you have the previous vue-cli (1.x or 2.x) package installed globally,
you need to uninstall it first with npm uninstall vue-cli -g or yarn global remove vue-cli.
安装
npm uninstall vue-cli -g // 卸载旧版本
# OR
yarn global remove vue-cli
npm install -g @vue/cli // 安装最新的版本
# OR
yarn global add @vue/cli
Vue CLI 3 uses the same vue binary, so it overwrites Vue CLI 2 (vue-cli).
If you still need the legacy vue init functionality, you can install a global bridge:
WARNING
If you are on Windows using Git Bash with minTTY, the interactive prompts will not work.
You must launch the command as winpty vue.cmd create hello-world.
If you however want to still use the vue create hello-world syntax, you can alias the command by adding the following line to your ~/.bashrc file. alias vue='winpty vue.cmd'
You will need to restart your Git Bash terminal session to pull in the updated bashrc file.