1. vite创建vue环境
[root@Python Vue]# npm init vite@latest
Need to install the following packages:
create-vite@3.2.0
Ok to proceed? (y)
✔ Project name: … vite-demo
✔ Select a framework: › Vue
✔ Select a variant: › TypeScript
Scaffolding project in /opt/Vue/vite-demo...
Done. Now run:
cd vite-demo
npm install
npm run dev
2. 安装项目依赖
[root@Python Vue]# cd vite-demo/
[root@Python vite-demo]# ll
total 24
-rw-r--r--. 1 root root 362 Oct 31 15:30 index.html
-rw-r--r--. 1 root root 377 Oct 31 15:30 package.json
drwxr-xr-x. 2 root root 22 Oct 31 15:30 public
-rw-r--r--. 1 root root 1377 Oct 31 15:30 README.md
drwxr-xr-x. 4 root root 106 Oct 31 15:30 src
-rw-r--r--. 1 root root 488 Oct 31 15:30 tsconfig.json
-rw-r--r--. 1 root root 184 Oct 31 15:30 tsconfig.node.json
-rw-r--r--. 1 root root 156 Oct 31 15:30 vite.config.ts
[root@Python vite-demo]# npm install
added 46 packages, and audited 47 packages in 15s
4 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
# 出现node_modules正常
[root@Python vite-demo]# ll
total 84
drwxr-xr-x. 37 root root 4096 Oct 31 15:33 node_modules