# 项目初建

# 环境准备

  • node.js 安装
    • js 在操作系统上脱离浏览器的运行环境

node # 进入node 编写js

.exit # 退出

# 执行js文件
node xx.js

  • 包管理工具 npm --> yarn
    • 安装node.js 的时候自带
    • yarn 更快、更稳定、有历史缓存

# 设置npm淘宝镜像
npm install --registry=https://registry.npm.taobao.org
# 安装 yarn
npm install -g yarn

# 设置yarn镜像
yarn config set registry https://registry.npm.taobao.org -g

# 设置 sass 镜像 (包比较大所有安装慢)
yarn config set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass -g

# 安装 vue-cli
yarn global add @vue/cli

# 创建项目

vue create hello-world

vue-cli v4.0.5
- ? Please pick a preset:
  - Manually select features
- ? Check the features needed for your project:
  - Babel
  - Router
  - Vuex
  - CSS Pre-processors
  - Unit Testing
- ? Use history mode for router?
  - Y
- ? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default):
  - Sass/SCSS(with node-sass)
- ? Pick a unit testing solution: 
  - Jest
- ? Where do you prefer placing config for Babel, PostCSS, ESLint, etc.?
  - In package.js
- ? Save this as a preset for future projects? (y/N) 
  - N

上次更新时间: 2019-12-1 1:02:28 AM