kush 2003
kush 2003

Reputation: 11

problem with react + vite while running the npm run dev command

npm run dev

[email protected] dev vite

failed to load config from C:\Users\vyask\Desktop\8th sem internship\mern-blog\client\vite.config.js error when starting dev server: Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'vite' imported from C:\Users\vyask\Desktop\8th sem internship\mern-blog\client\vite.config.js.timestamp-1711704484714-33a082f4a0378.mjs at packageResolve (node:internal/modules/esm/resolve:854:9) at moduleResolve (node:internal/modules/esm/resolve:927:18) at defaultResolve (node:internal/modules/esm/resolve:1157:11) at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:390:12) at ModuleLoader.resolve (node:internal/modules/esm/loader:359:25) at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:234:38) at ModuleWrap. (node:internal/modules/esm/module_job:87:39) at link (node:internal/modules/esm/module_job:86:36)

i am trying to run the react app

Upvotes: 1

Views: 2478

Answers (1)

khalid
khalid

Reputation: 21

It appears that the Vite package is missing or not correctly installed in your project. To resolve this issue:

  1. Open your terminal.
  2. Navigate to your project directory: cd path/to/your/project.
  3. Run npm install vite to install Vite in your project.

If you already have Vite installed and are still encountering this issue, try deleting the node_modules folder and the package-lock.json file in your project directory, and then run npm install to reinstall your packages.

Upvotes: 2

Related Questions