[email protected] 對等的vue-template-compiler【Vue】

前置說明:在研究別人的開源項目的時候,本地安裝安裝好項目依賴。
運行npm run start ,出現如下

- [email protected] (D:\IDEA_Work\fulingfront\node_modules\[email protected]@vue\dist\vue.runtime.common.js)
- [email protected] (D:\IDEA_Work\fulingfront\node_modules\[email protected]@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.

    at Object.<anonymous> (D:\IDEA_Work\fulingfront\node_modules\[email protected]@vue-template-compiler\index.js:10:9)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (D:\IDEA_Work\fulingfront\node_modules\[email protected]@vue-loader\lib\parser.js:1:80)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)

 @ ./src/main.js 2:0-24
 @ multi ./node_modules/[email protected]@webpack-dev-server/client?http://localhost:8710 webpack/hot/dev-server babel-polyfill ./src/main.js

 error  in ./src/components/icon-svg/index.vue

Module build failed: Error:

Vue packages version mismatch:

- [email protected] (D:\IDEA_Work\fulingfront\node_modules\[email protected]@vue\dist\vue.runtime.common.js)
- [email protected] (D:\IDEA_Work\fulingfront\node_modules\[email protected]@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.

    at Object.<anonymous> (D:\IDEA_Work\fulingfront\node_modules\[email protected]@vue-template-compiler\index.js:10:9)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (D:\IDEA_Work\fulingfront\node_modules\[email protected]@vue-loader\lib\parser.js:1:80)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)

說明:從錯誤中,可以看到是由於Vue和vue-template-compiler的版本不匹配導致的

解決:

先刪除文件夾node_modules文件夾下的vue-template-compiler文件

>cnpm install [email protected] --save-dev

再次運行 npm run start  即可
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章