2017-01-06 161 views
0

我一直在使用VueJS 2开发几个星期,并尝试部署生产,但遇到了问题。我想测试一个不同的系统,所以我删除了我的node_modules文件夹并重建了我的依赖关系(npm install)。但是,当我现在运行dev时,它不再工作了。我没有改变我的package.json中的任何东西。我的网页给我以下错误:VueJS重新安装依赖关系

您正在开发模式下运行Vue。 确保在部署生产时打开生产模式。 查看更多提示在https://vuejs.org/guide/deployment.html

(unknown) ReferenceError: _h is not defined 
at Proxy.render (eval at (app.js:1596), :3:14658) 
at VueComponent.Vue._render (eval at (app.js:606), :3096:22) 
at VueComponent.eval (eval at (app.js:606), :2464:21) 
at Watcher.get (eval at (app.js:606), :1663:27) 
at new Watcher (eval at (app.js:606), :1655:12) 
at VueComponent.Vue._mount (eval at (app.js:606), :2463:19) 
at VueComponent.Vue$3.$mount (eval at (app.js:606), :6104:15) 
at VueComponent.Vue$3.$mount (eval at (app.js:606), :8494:16) 
at init (eval at (app.js:606), :2777:11) 
at createComponent (eval at (app.js:606), :4120:9) 
logError 

这怎么可能?

回答

0

错误似乎来自vue-template-compiler,它也被描述为here。解决方案可以将vue降级到之前的2.1.5,因为这是引入错误的地方(也将vue-template-compiler降级为相同版本)。

我发现一个更多的参考here其中指向this提交。

+0

好的,我会尝试。但我没有使用vue-template-compiler(它不在我的依赖项中)。到目前为止工作得很好。我需要它吗? – Cake

+0

另外,我似乎无法降级我的Vue。我在package.json中将其更改为2.1.8,但后来将其更改回2.0.1。但是,我的Vue devtools一直告诉我我正在运行2.1.8。我删除了所有节点模块并重新安装!它从哪里获得2.1.8? – Cake

+0

@Cake您可能没有直接使用它,但可能是您正在使用的软件包的依赖项之一,您可以根据vue-template-compiler' [here](https:// www。 npmjs.com/browse/depended/vue-template-compiler)。 – Saurabh