vue.js: 下载项目需要vite: Command 'vite' not found
一,运行vite报错:
$ vite build
Command 'vite' not found, but can be installed with:
sudo apt install vite
二,全局安装:
1,检查是否有安装vite
$ npm list -g vite
/home/liuhongdi/.nvm/versions/node/v22.20.0/lib
└── (empty)
全局安装:
$ npm install -g vite
added 15 packages in 5s
8 packages are looking for funding
run `npm fund` for details
检查效果:
$ npm list -g vite
/home/liuhongdi/.nvm/versions/node/v22.20.0/lib
└── vite@8.0.10
$ vite --version
vite/8.0.10 linux-x64 node-v22.20.0
浙公网安备 33010602011771号