vue创建并初始化项目

一、npm安装

https://nodejs.org/en/中下载nodejs并安装
1.cmd检测是否安装成功
node –v 和 npm –v
2.使用淘宝的npm 镜像
$  npm  install  -g  cnpm  --registry=https://registry.npm.taobao.org
 

二、第二步项目初始化

1.安装vue-cli
cnpm install vue-cli -g      //全局安装 vue-cli
三、新建vue项目

在运行(Ctrl+R)中输入cmd进入dos:

vue init webpack  "项目名称"
? Project name //项目名称 ? Project description A Vue.js project //项目描述,默认的 ? Author c *@qq.com //默认,回车即可 ? Vue build (Use arrow keys) //默认,回车即可 ? Vue build standalone //默认,回车即可 ? Install vue-router? No //是否安装路由 ? Use ESLint to lint your code? Yes //是否用ESLint来规范我们的代码 ? Set up unit tests No //是否使用自动化的测试工具 ? Setup e2e tests with Nightwatch? No //使用nightatch设置E2E测试 ? Should we run npm install for you after the project has been created? (recommended) npm //选择npm安装
 
四、安装相关依赖

cnpm install

五、运行项目

npm run dev

猜你喜欢

转载自www.cnblogs.com/angel-devil/p/11906559.html