1.在Windows上安装Nodejs
#查看版本
$ npm -v
#升级 npm
cnpm install npm -g
#升级或安装 cnpm
npm install cnpm -g
2.安装vue
#最新稳定版
npm install vue或cnpm install vue
#ps:cnpm需要配置淘宝镜像
#查看版本
vue -V
3.创建一个vue项目
# 全局安装 vue-cli
cnpm install --global vue-cli
# 创建一个基于 webpack 模板的新项目
vue init webpack myproject
#下面这些一直回车即可
? Project name myproject
? Project description A Vue.js project
? Author 123<123@qq.com>
? Vue build (Use arrow keys)
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? Yes
? Pick an ESLint preset Standard
? Set up unit tests Yes
? Pick a test runner jest
? Setup e2e tests with Nightwatch? Yes
? Should we run `npm install` for you after the project has been created? (recom
? Should we run `npm install` for you after the project has been created? (recom
mended) npm
vue-cli · Generated "myproject".
# Installing project dependencies ...
# ========================
4.进入项目、安装并运行
cd myproject
npm install 或 cnpm install
npm run dev
5.在浏览器中输入以下地址
浏览器输入地址后会出现以下界面,证明项目创建成功