搭建vue-cli并初始化项目

#安装淘宝镜像
npm install -g cnpm --registry=https://registry.npm.taobao.org
#安装vue-cli
cnpm install vue-cli -g
#查看是否安装成功
vue -V
初始化项目 --projectdemo 项目名
vue init webpack projectdemo
? Project name demo                          //项目名称
? Project description this is demo        //项目描述
? Author ananiha                               // 作者
    // 然后回车
? Install vue-router? Y                        //y   安装路由
? Use ESLint to lint your code? N        // n
? Set up unit tests No                       // n
? Setup e2e tests with Nightwatch? N             // n 
? Should we run `npm install` for you after the project has been cr
? Should we run `npm install` for you after the project has been cr
? Should we run `npm install` for you after the project has been cr

mended) (Use arrow keys)
   Yes, use NPM
> Yes, use Yarn
   No, I will handle that myself
                           //回车 
To get started:

  cd demo
  npm run dev

Documentation can be found at https://vuejs-templates.github.io/webpack
   //根据以上提示输入
cd demo                 //进入目录
cnmp install            //提示会少这一命令 如果根据提示启动失败加这一句
npm run dev           //启动 会自己跳转浏览

猜你喜欢

转载自www.cnblogs.com/yuanzessrs/p/11750941.html