vue项目的搭建

安装node

  • node安装包的下载link
    • 下载长期支持版
    • 解压文件
    • 安装(下一步、下一步、下一步…)
    • 检查是否安装成功(命令行输入)
C:\Users\Administrator>node -v
v12.13.0
  • node环境搭建成功,拥有npm包管理工具
  • 通常情况下npm安装包文件速度较慢或失败(由于有些npm资源被屏蔽或者是国外资源的原因),所以可以安装使用cnpm(npm的国内镜像)
  • 安装cnpm淘宝镜像
npm install -g cnpm --registry=http://registry.npm.taobao.org

安装vue-cli 脚手架构建工具

npm install -g vue-cli
  • 检查是否安装成功
C:\Users\Administrator>vue -V
@vue/cli 4.4.1
  • vue-cli 脚手架安装成功

vue 项目的搭建

vue create project-name   //回车


  default (babel, eslint)
  Manually select features  //选择、回车
---------->
 ? Please pick a preset: Manually select features
 ? Check the features needed for your project:
 (*) Babel
 ( ) TypeScript
 ( ) Progressive Web App (PWA) Support
 (*) Router
 (*) Vuex
>(*) CSS Pre-processors
 ( ) Linter / Formatter
 ( ) Unit Testing
 ( ) E2E Testing     
 //A全选 、反选      回车
 
? Please pick a preset: Manually select features
? Check the features needed for your project: Babel, Router, Vuex, CSS Pre-processors
? Use history mode for router? (Requires proper server setup for index fallback in production) Yes
? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Sass/SCSS (with node-sass)
? Where do you prefer placing config for Babel, ESLint, etc.? In package.json
? Save this as a preset for future projects? No


Vue CLI v4.4.1
✨  Creating project in C:\Users\Administrator\project-name.
🗃  Initializing git repository...
⚙️  Installing CLI plugins. This might take a while...
 --------->
 // 开始构建项目
 -------->
 Binary found at C:\Users\Administrator\project-name\node_modules\node-sass\vendor\win32-x64-72\binding.node
Testing binary
Binary is fine
added 90 packages from 65 contributors in 12.145s
⚓  Running completion hooks...

📄  Generating README.md...

🎉  Successfully created project project-name.
👉  Get started with the following commands:

 $ cd project-name
 $ npm run serve
 
 C:\Users\Administrator>
  • 项目搭建成功
  • cd project-name(进入项目)
  • npm run serve(将项目跑起来)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

嗳华裳

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值