1: If you have already installed vue-cli2 In my words , You have to unload it first , The order is as follows
// First check to see if it has been installed vul-cli vue -V // If there is one , Just use the following command to unload npm uninstall vue-cli -g
2: install vue-cli 4.0.5
// One click initialization project npm init -y // install vue-cli npm install @vue/cli -g // It can also be used cnpm To install
, It's faster cnpminstall @vue/cli -g
I use it for installation npm Installation error , But with cnpm The installation was successful , Some people are just the opposite , I don't know why .

3: Create a project
//1. command enter vue create Project name //2. Select custom configuration Manually select features //3. Select the configuration you need
Babel( Mandatory ) TypeScript( Used in the project ts In terms of development , Check it ) Progressive Web App (PWA) Support (
Interface cache , Optimization project ) Router Vuex CSS Pre-processors (css Preprocessor , need ) Linter / Formatter (
Code format , General default selection ) Unit Testing ( Code testing ) E2E Testing( Requirement interface testing ) //4. According to the configuration you choose Y/N choice
//5. After selection , You can run the project npm run serve

Technology