下载node.js
官网下载
下载后打开,默认安装
打开cmd,查看npm版本
npm -v
npm 的官方镜像是非常慢的,推荐使用淘宝 NPM 镜像
npm install -g cnpm --registry=https://registry.npm.taobao.org
全局安装 vue-cli
cnpm install --global vue-cli
创建一个基于webpack模板的新项目
vue init webpack my-project
需要进行一些配置,全部默认回车
? Project name my-project
? Project description A Vue.js project
? Author
? 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? (recommended) npm
进入项目,安装并执行
cd my-project
cnpm install
cnpm run dev
打开