首次加载vue+vite项目报错
报错了:
failed to load config from D: ***** vite.config.js
error when starting dev server:
Error: Cannot find module 'vite'
Require stack:
- D: ***** vite.config.js
- D:*****node\chunks\dep-df561101.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1026:15)
at Function.Module._load (node:internal/modules/cjs/loader:871:27)
at Module.require (node:internal/modules/cjs/loader:1098:19)
at Object.<anonymous> (D:\git\site\vite.config.js:35:19)
at Module._compile (node:internal/modules/cjs/loader:1196:14)
at Object._require.extensions.<computed> [as .js] (file:///D:/Program%20Files/nodejs/node_global/node_modules/vite/dist/node/chunks/dep-df561101.js:66253:24)
at Module.load (node:internal/modules/cjs/loader:1074:32)
at Function.Module._load (node:internal/modules/cjs/loader:909:12)
at Module.require (node:internal/modules/cjs/loader:1098:19)
是因为我下载的项目没有安装module
需要全部安装一下
命令
npm install