Drawing on a lot of information on the Internet, I only mention vite installation here, not vue-cli.
// vite的安装
npm install -g create-vite-app
Install vite first. After successful installation, you can create a vue3 project through the following command
// 第一种
create-vite-app test
// 第二种
npm init vite-app test
npm init @vitejs/app // 推荐这种
1. The following is an introduction to the npm installation method. If you install ts, we recommend npm init @vitejs/app, because this will help you configure ts, saving you the need to install ts and configure it yourself.
1、npm init @vitejs/app // 推荐这个安装方式,包含ts安装
2、npm init vite-app <project-name>
1.1. If you use npm init @vitejs/app to name the installation, make sure the node.js version is >= 10.16.0. If the version is lower than this, the project can be created successfully, but it just cannot run and a "vue3 Error:" is reported. Cannot find module 'worker_threads'" error, this is also a pitfall
Check the node version, node-v
1.2. To upgrade the node version in Windows system, it is best to re-download and install the overlay. Download address: Previous Releases | Node.js
1.3. Among the node versions supported by win7, some say it supports up to 13.14.0 , and some say 12.18.4. I chose the 12.12.0 version more cautiously.
Vite creation project installation steps
Successful installation directory