1. 确认安装nodejs

搭建vue前端项目

 

 2. 确认安装npm

搭建vue前端项目

 

 3. 国内npm下载依赖的速度太慢,淘宝镜像cnpm速度快,所以注册cnpm代替npm。

npm install cnpm -g --registry=https://registry.npm.taobao.org

搭建vue前端项目

 

 4. 安装vue-cli

cnpm install -g vue-cli

5. 初始化项目,打包工具选择webpack,项目名称:vue-test-ui

vue init webpack vue-test-ui

6. 接下来,填写一些信息,可以直接enter。

Project name 项目名
Project description 项目名描述
Author 作者邮箱
Use ESLint to lint your code? 是否需要ESlist语法检查
Setup unit tests with Karma + Mocha? 是否需要单元测试
Setup e2e tests with Nightwatch? Yes是否需要e2e测试

 

7. 这一项可以选择yes,也可以选择no。

搭建vue前端项目

 

 选择yes使用npm install命令安装,选择no,自行使用cnpm install命令安装。

8. 出现这个就可以启动项目了

搭建vue前端项目

 

 9. 启动项目

cnpm run dev

10. 访问项目http://localhost:8080/#/

搭建vue前端项目

 

 

11. 打包项目

cnpm run build

相关文章:

  • 2021-06-28
  • 2022-12-23
  • 2022-12-23
  • 2021-09-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
猜你喜欢
  • 2021-06-24
  • 2021-06-08
  • 2021-04-19
  • 2021-11-08
  • 2021-10-31
  • 2021-12-27
  • 2021-07-10
相关资源
相似解决方案