vue-cli创建项目:
一、下载node;
1.node -v —— 检查node版本号
二、安装vue脚手架(全局安装vue-cli)
1.用npm安装(npm install -g vue-cli)——国际开源库生态系统
2.用cnpm安装(cnpm install -g vue-cli)——国内镜像安装:用淘宝镜像安装cnpm才可以使用
检查是否安装上(anpm -v)
三、安装webpack
1.npm install -g webpack
三、生成项目
1.vue init webpack + (项目名称)——回车
2.Project name(项目名称)——直接回车
3. Project description(项目描述)——同上
4.Author(作者)——同上
5.Vue build(打包方式)——直接回车
6 Install vue-router? (Y/n) 选 y
7. Use ESLint to lint your code? (Y/n) (使用ESLint 规范代码)选n
8.Pick an ESLint preset (Use arrow keys)——直接回车
9. Set up unit tests (Y/n) 选n
10. Setup e2e tests with Nightwatch? (Y/n) 选n
11.Should we run npm install
for you after the project has been created? (recommended) (Use arrow keys)
Yes, use NPM (选这个)
Yes, use Yarn
No, I will handle that myself
// 项目搭建步骤