Laravel mix vue-template-compiler must be installed as a peer dependency
Asked Answered
L

2

15

i got a fresh laravel installation, everything compile well but when I install vuex or vue router through npm, compiling wont work anymore, i got this error:

Error: [vue-loader] vue-template-compiler must be installed as a peer dependency, or a compatible compiler implementation must be passed via options.

Libbylibeccio answered 12/12, 2018 at 5:46 Comment(0)
E
25

The vue and vue-template-compiler module version must be the same in your package.json.

This was my code:

"devDependencies": {
    "vue": "^2.5.17",
    "vue-loader": "^15.5.1",
    "vue-template-compiler": "^2.5.21"
},

I changed the vue version to 2.5.21, then ran npm update to update the base version of VueJS.

Eucharis answered 11/1, 2019 at 12:14 Comment(3)
I had the same issue. vue-template-compiler 2.5.22 and vue 2.5.17. Updated vue to ^2.5.22 (same as vue-template-compiler) and it works.Pocket
Why Laravel does not add vue-loader and vue-template-compiler as dev dependencies when compiling assets with mix?Eos
i have the same error,. it didn't worked. my version is 2.6.10Aleron
N
0

npm install vue-loader --save-dev

npm install vue-template-compiler --save-dev

Nonu answered 15/12, 2018 at 19:25 Comment(2)
//Would have been really helpful if you posted your package.json but I hope this helpsNonu
It would be good to include a little explanation (e.g. "looks like you are missing some dependencies:") as well as formatting your commands by surrounding them with backticks (`).Isostasy

© 2022 - 2024 — McMap. All rights reserved.