以下是错误消息:
Vue packages version mismatch:
- vue@2.5.2
- vue-template-compiler@2.5.13
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> (/Users/me/test-dev/vue-test/node_modules/vue-template-compiler/index.js:8:9)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/me/test-dev/vue-test/node_modules/vue-loader/lib/parser.js:1:80)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
@ ./src/router/index.js 4:0-38
@ ./src/index.js
@ multi ./build/dev-client ./src/index.js
> Listening at http://localhost:8080
我尝试了两个建议:更新并重新安装。似乎都没有帮助。
以下是我设置工作演示的codesandbox的链接。我从codesandbox下载了示例包(请参阅第一个链接上的下载按钮),然后在本地运行npm install
(Mac OS X Sierra)。
Codesandbox: https://codesandbox.io/s/1rxq4j1on3
答案 0 :(得分:5)
Vue和vue模板编译器必须使用相同的版本。
最新的vue版本是:2.5.13
https://www.npmjs.com/package/vue
npm install vue
最新模板编译器版本:2.5.13
https://www.npmjs.com/package/vue-template-compiler
npm install vue-template-compiler
将相同版本的每个版本添加到package.json或通过命令行安装