Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

spook1's avatar

vue packages version mismatch

Trying to get vue 3 to work, following directions from:

https://laracasts.com/series/whats-new-in-vue-3/episodes/1

I cannot get past npm run dev step... have tried all kinds of stuff to install vue 3, laravel-mix etc..

Id did try:

update vue-template-compiler

and

npm install vue@next laravel-mix@next --force

and more similar actions..

Afraid I messed up.. What to do?

I get the errors:

× Mix
  Compiled with some errors in 3.09s

ERROR in ./resources/js/components/ExampleComponent.vue
Module Error (from ./node_modules/vue-loader/lib/index.js):


Vue packages version mismatch:

- [email protected] (D:\laravel\stratego\node_modules\vue\index.js)
- [email protected] (D:\laravel\stratego\node_modules\vue-template-compiler\package.json)

This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader@>=10.0, simply update vue-template-compiler.
If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.


ERROR in ./resources/js/components/ExampleComponent.vue
Module build failed (from ./node_modules/vue-loader/lib/index.js):
TypeError: Cannot read property 'parseComponent' of undefined
    at parse (D:\laravel\stratego\node_modules\@vue\component-compiler-utils\dist\parse.js:15:23)
    at Object.module.exports (D:\laravel\stratego\node_modules\vue-loader\lib\index.js:67:22)

webpack compiled with 2 errors
npm ERR! code 1
npm ERR! path D:\laravel\stratego
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c mix

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\xxxxx\AppData\Local\npm-cache\_logs21-03-23T20_21_00_218Z-debug.log
npm ERR! code 1
npm ERR! path D:\laravel\stratego
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c npm run development

npm ERR! A complete log of this run can be found in:
0 likes
5 replies
spook1's avatar

Deleted package-lock.json Now the only error left reads:

ERROR  Failed to compile with 1 errors                                                                                                           22:54:21
 error  in ./resources/js/components/ExampleComponent.vue

Syntax Error: TypeError: Cannot read property 'parseComponent' of undefined
syntactical's avatar

Try removing package-lock.json file and node_modules directory and then reinstall the packages. It looks like your vue-template-compiler and vue are on different versions

spook1's avatar

Did delete package.json It helped, as nd left me with the syntax error in the second post.

Any suggestions for that?

Please or to participate in this conversation.