Ashraam's avatar
Level 41

Can't install @vitejs/plugin-vue

Hi,

I've just installed a fresh version of Laravel 9 and wanted to use Vite and Vue, but when I do

@vitejs/plugin-vue

I've got a dependency error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: undefined@undefined
npm ERR! Found: [email protected]
npm ERR! node_modules/vite
npm ERR!   dev vite@"^2.9.14" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer vite@"^3.0.0" from @vitejs/[email protected]
npm ERR! node_modules/@vitejs/plugin-vue
npm ERR!   dev @vitejs/plugin-vue@"^3.0.1" from the root project
npm ERR! 

Here is my package.json

"private": true,
    "scripts": {
        "dev": "vite",
        "build": "vite build"
    },
    "devDependencies": {
        "@vitejs/plugin-vue": "^3.0.1",
        "axios": "^0.25",
        "laravel-vite-plugin": "^0.4.0",
        "postcss": "^8.1.14",
        "vite": "^2.9.14"
    }

What should I do ?

0 likes
9 replies
28a.gdev's avatar

as well as doing Sinnbeck's answer I had to also add

"@vitejs/plugin-vue": "^3.0.1", to my Dev dependencies in package.json.

Then when i run npm install && npm run dev it works!

2 likes

Please or to participate in this conversation.