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

时间:2019-01-04 15:17:17

标签: vue.js vue-cli-3

我正在尝试关注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.

如何使它正常工作?

1 个答案:

答案 0 :(得分:1)

您正在尝试使用vue-cli 3版本的vue-cli 2命令。

从版本3开始,用于初始化新项目的命令已更改,因此您可以执行自己不想写的vue init webpack-simple project,而不必写vue create project

相关问题