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

 

posted @ 2026-05-03 21:04  刘宏缔的架构森林  阅读(11)  评论(0)    收藏  举报