使用vue-cli3初始化一个项目

安装

  • vue2 :npm install -g vue-cli
  • vue3 :npm install -g @vue/cli

若是安装报如下错误:

npm WARN deprecated [email protected]: cross-spawn no longer requires a build toolchain, use it instead
npm ERR! code Z_BUF_ERROR
npm ERR! errno -5

运行 :npm install -g @vue/cli --registry=https://registry.npm.taobao.org

创建

  • vue3
vue create vue-learn
  • 回车之后会出现以下画面
Vue CLI v3.9.3
┌────────────────────────────┐
│  Update available: 3.10.0  │
└────────────────────────────┘
? Please pick a preset: (Use arrow keys)
❯ test (vue-router, vuex, stylus, babel, eslint, unit-mocha) 
  default (babel, eslint) 
  Manually select features 

启动

cd vue-learn
npm run serve

你可能感兴趣的:(使用vue-cli3初始化一个项目)