终端CMD载入Vue-cli手脚架
一、终端输入 文件夹 给权限
sudo chown -R $USER /usr/local
二、终端输入 全局安装vue-cli 手脚架
npm install -g @vue/cli
三、终端输入 创建项目
vue create 项目名
四、终端窗口 选择选项
1.选择 版本
Vue CLI v5.0.1
? Please pick a preset:
Default ([Vue 3] babel, eslint)
Default ([Vue 2] babel, eslint)
❯ Manually select features 《《《《《《《《《
2.选择 脚本 (空格键盘选择)
Vue CLI v5.0.1
? Please pick a preset: Manually select features
? Check the features needed for your project: (Press <space> to select, <a> to t
oggle all, <i> to invert selection, and <enter> to proceed)
◉ Babel
◯ TypeScript
◯ Progressive Web App (PWA) Support
❯◉ Router 《《《《《《《《《《《《《《《《《《《《《
◯ Vuex
◯ CSS Pre-processors
◯ Linter / Formatter
◯ Unit Testing
◯ E2E Testing
3.选择 vue版本
Vue CLI v5.0.1
? Please pick a preset: Manually select features
? Check the features needed for your project: Babel, Router
? Choose a version of Vue.js that you want to start the project with
❯ 3.x
2.x
4.选择 校验
Vue CLI v5.0.1
? Please pick a preset: Manually select features
? Check the features needed for your project: Babel, Router
? Choose a version of Vue.js that you want to start the project with 3.x
? Use history mode for router? (Requires proper server setup for index fallback
in production) (Y/n)
5.选择 配置文件 是否写在一起
Where do you prefer placing config for Babel, ESLint, etc.? (Use arrow keys)
❯ In dedicated config files 《〈《〈《〈《〈《
In package.json
6.选择 是否将此保存为未来项目的预设?(是/否)
Save this as a preset for future projects? (y/N)
7.【终端提示】开始创建载入(Creating project in /Volumes/WuteLin/Webs/Vue项目/nw001. 指项目存放目录路径)
Vue CLI v5.0.1
✨ Creating project in /Volumes/WuteLin/Webs/Vue项目/nw001.
? Initializing git repository...
⚙️ Installing CLI plugins. This might take a while...
⸨#########⠂⠂⠂⠂⠂⠂⠂⠂⠂⸩ ⠸ idealTree:@vue/cli-shared-utils: sill fetch manifest ms@
Installing CLI plugins. This might take a while...
added 846 packages in 40s
? Invoking generators...
? Installing additional dependencies...
added 19 packages in 6s
⚓ Running completion hooks...
? Generating README.md...
? Successfully created project nw001.
? Get started with the following commands:
$ cd nw001
$ npm run serve
8. ok 创建完成
664 Views