Search code examples
vue.jswebpacklaravel-8npm-installlaravel-mix

When running "npm run dev" [webpack-cli] Error: Cannot find module 'vue/compiler-sfc' [Laravel with Vue.js]


after I installed vue.js on my laravel project and running npm run dev this error comes out.

enter image description here


Solution

  • I was having the same problem, basically what was happening is that my version of VUE did not match the version of vue-loader and vue-template-compiler

    To solve it I just had to match the versions in package.json and npm install here are the versions I'm using

    "vue": "^2.6.11",
    "vue-loader": "^15.9.6",
    "vue-template-compiler": "^2.6.12",
    "laravel-mix": "^6.0.6",