Attention: Things that look inconspicuous when you look at it can always make you feel bad. According to this step, you will avoid a lot of detours. . .
1: Download Node.js
First, download the installation package
Access address:
https://nodejs.org/en/download/
3. Verification version
- < p>Win + R, enter cmd, open the dos command line, enter
node -v
to view the NodeJS version numbernpm config set prefix "D:\NodeJS\node_global" npm config set cache "D:\NodeJS\node_cache"
- 1
- 2
-
Set environment variables, close the cmd window, “My Computer”-right click-“Properties”-“Advanced System Settings”-“Advanced”-“Environment Variables”
npm install express -g # -g means global installation
-
This is already a successful installation, because it is very slow to use npm in China. So here we recommend to use Taobao npm mirror, use Taobao’s cnpm command management tool to replace the default npm management tool: $ npm install –g cnpm—registry=https< span class="pun">://registry.npm.taobao.org;
Three: After the Taobao image is successfully installed, we can global vue-cli scaffolding, enter the command: cnpm install—globalvue–cli Press Enter; to verify whether the installation is successful, enter vue in the command, and the vue information will be displayed, and the installation is successful;
-
Four: After the scaffolding is completed, we will start to build a new project. At this time, I suggest that you don’t install the On the C drive, because the file downloaded by vue is relatively large, if you want to change the drive, you can directly enter D: Enter to change the drive directly,
Then we start to create a new project and enter the command: vue init webpackmy–project Enter , My-project is the name of my own folder, which is a webpack-based project. After inputting, I keep pressing Enter until it appears whether I want to install vue-route,
This is what we need in the project, so just type y and press Enter
- < img alt="Share a picture" src="/wp-content/uploads/images/os/windows/1626798002483.png">
This is basically successful, and the rest of the startup test Not much to say,