關於舊版本
Vue CLI 的包名稱由 vue-cli 改成了 @vue/cli。
如果你已經全局安裝了舊版本的 vue-cli (1.x 或 2.x),你需要先通過 npm uninstall vue-cli -g 或 yarn global remove vue-cli 卸載它。
Node 版本要求
Vue CLI 4.x 需要 Node.js v8.9 或更高版本 (推薦 v10 以上)。你可以使用 n,nvm 或 nvm-windows 在同一台電腦中管理多個 Node 版本。
安裝新的安裝包:npm install -g @vue/cli
安裝完后,查看版本:vue -version
開始搭建項目:vue create xxx(這里的xxx是文件名,可以根據需求來命名)
選擇預設:Default ([Vue 2] babel, eslint)
Default (Vue 3 Preview) ([Vue 3] babel, eslint)
Manually select features (自定義選擇,默認選擇三個)

選擇版本:2.x
3.x (Preview)
編碼規則:ESLint with error prevention only (只使用官網的推薦規則)
ESLint + Airbnb config
ESLint + Standard config
ESLint + Prettier
Pick additional lint features: (Press <space> to select, <a> to toggle all, <i> to invert selection)
(*) Lint on save (默認選擇)
( ) Lint and fix on commit
配置文件選擇存儲位置:Where do you prefer placing config for Babel, ESLint, etc.?
In dedicated config files (在專用配置文件中)
In package.json
將此保存為預設以供將來的項目使用
Save this as a preset for future projects? (y/N)(默認Y)
選擇保存位置:Save preset as:
等待安裝完成
運行項目:npm run serve
出了一個錯誤

應該是依賴沒有安裝上,安裝一下依賴:npm i --save-dev vue-loader-v16

啟動成功

