0

I'm trying Npm run dev in my front-end folder but there's a error

PS C:\Users\PICHAU\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\home\viceek\ProjetoI\front-end> npm run dev

[email protected] dev vite

failed to load config from C:\Users\PICHAU\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\home\viceek\ProjetoI\front-end\vite.config.ts error when starting dev server: Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'vite' imported from C:\Users\PICHAU\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\home\viceek\ProjetoI\front-end\vite.config.ts.timestamp-1665345725237.mjs at new NodeError (node:internal/errors:393:5) at packageResolve (node:internal/modules/esm/resolve:860:9) at moduleResolve (node:internal/modules/esm/resolve:909:20) at defaultResolve (node:internal/modules/esm/resolve:1124:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:837:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:76:40) at link (node:internal/modules/esm/module_job:75:36)

my vite.config.ts folder:i

import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()]
})```

2
  • 1
    npm install -D vite? Commented Oct 9, 2022 at 22:29
  • can you share your package.json file? Commented Oct 10, 2022 at 12:26

1 Answer 1

0

Check out if all the dependencies are installed like react and react-dom

just run:-

for npm

npm install react react-dom

for yarn

yarn add react react-dom
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.