Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error : vue-loader requires @vue/compiler-sfc to be present in the dependency tree

I'm getting this error when I'm trying to do

npm run serve

I have tried npm update sudo npm serve. It didn't work. I also tried deleting the package-lock.json file and doing npm install after that, and that too didn't work. I also downgraded the version of the vue-loader to 15.9.2 and that also didn't work

like image 434
gokul_santhosh Avatar asked Sep 29 '20 10:09

gokul_santhosh


2 Answers

Actually, you are missing the library so you just have to install it with

npm i @vue/compiler-sfc

like image 163
Abdulrahman Falyoun Avatar answered Sep 22 '22 07:09

Abdulrahman Falyoun


This is a new thing in vue-loader@16. To fix this, assuming you are using Vue 2, you should downgrade:

yarn add vue-loader@15

Note that you also need vue-template-compiler, the same version as the version of Vue you are using.

like image 38
Johannes Avatar answered Sep 22 '22 07:09

Johannes