在 git-bash 上创建 vue-cli3 项目

creating vue-cli3 project on git-bash

我正在尝试关注 https://alligator.io/vuejs/demistifying-vue-webpack/。基于此我尝试了:

$ vue init webpack-simple demistify-project

 Command vue init requires a global addon to be installed.
 Please run yarn global add @vue/cli-init and try again.

所以我尝试了:

$ yarn global add @vue/cli-init
yarn global v1.12.3
[1/4] Resolving packages...
warning @vue/cli-init > vue-cli > coffee-script@1.12.7: CoffeeScript on NPM 
has moved to "coffeescript" (no hyphen)
warning @vue/cli-init > vue-cli > metalsmith > gray-matter > coffee- 
s cript@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...

warning "@vue/cli-init@3.2.0" has no binaries
Done in 15.69s.

然后:

$ vue init webpack-simple demistify-project

 Command vue init requires a global addon to be installed.
 Please run yarn global add @vue/cli-init and try again.

我如何让它工作?

您正在尝试将 vue-cli 2 命令与 vue-cli 3 版本一起使用。

从版本 3 开始,初始化新项目的命令发生了变化,因此要执行您想要的操作,您不会编写 vue init webpack-simple project 而是 vue create project