今天把远程仓库拉下项目,运行'npm run dev'时,报错


Module build failed: Error: Cannot find module 'vue-template-compiler'

报错原因:通常出现于一些依赖库的更新或者安装新的依赖库之后(可以认为npm update已经成为一种习惯),导致了vue和vue-template-compiler的版本不一致。

解决方案:统一vue和vue-template-compiler的版本


"vue": "2.3.3",
"vue-template-compiler": "2.4.4",

查了并试了一下只要运行两个代码就行了


npm instll
npm update

先运行npm install 之后会换一种报错:

Vue packages version mismatch
这种是重新安装了依赖,但是还没有更新

在接着运行npm update就可以使用

先运行npm update 报错还是一样,我们只要重新在执行一下npm install 安装一下就可以成功运行

原文地址:https://segmentfault.com/a/1190000012672988

Vue和vue-template-compiler版本之间的问题的更多相关文章

  1. You are using the runtime-only build of Vue where the template compiler is not available. Either pre

    在升级脚手架到vue-cli3.0版本的时候出现了这个报错: [Vue warn]: You are using the runtime-only build of Vue where the tem ...

  2. You are using the runtime-only build of Vue where the template compiler is not available.

    使用vue-cli搭建的项目,启动报错 You are using the runtime-only build of Vue where the template compiler is not a ...

  3. You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.

    异常 You are using the runtime-only build of Vue where the template compiler is not available. Either ...

  4. [Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.

    转载自:https://segmentfault.com/a/1190000006435886 解决办法:添加package.config.js配置文件中,添加本文章的红色部分代码 import vu ...

  5. [Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available

    原文链接https://blog.csdn.net/xiaomajia029/article/details/88320233 问题描述: 原因分析:在项目配置的时候,默认 npm 包导出的是运行时构 ...

  6. Vue Cli 报错:You are using the runtime-only build of Vue where the template compiler is not availabl

    报错原因: 这里引用的是vue.runtime.esm.js,造成的不能正常运行. vue-cli 2.x 解决方法: 在webpack.base.conf.js配置文件中多加了一段代码,将 vue/ ...

  7. Vue项目用了脚手架vue-cli3.0,会报错You are using the runtime-only build of Vue where the template compiler is not available.....

    摘自: https://blog.csdn.net/wxl1555/article/details/83187647 报错信息如下图: 报错原因是:vue有两种形式的代码:一种是compiler(模版 ...

  8. 聊聊Vue.js的template编译

    写在前面 因为对Vue.js很感兴趣,而且平时工作的技术栈也是Vue.js,这几个月花了些时间研究学习了一下Vue.js源码,并做了总结与输出. 文章的原地址:https://github.com/a ...

  9. Kendo-Grid for Vue API and Template

    写此博客的原因:在做项目时前端用的vue,后端用的jfinal.在前端veu中调用了kendo grid插件,但是在官方文档中对kendo grid for vue 的api和template都不太详 ...

  10. es6下 vue实例属性template不能使用

    esm模式下 不能使用template,需要引入非esm的vue.js,查看vue源码的包的dist目录下 文件标有esm是支持ems,没有标记,就是不支持(这个知识,怎么说了,应该属于webpack ...

随机推荐

  1. SparkShuffle调优原理和最佳实践

    在网络层,互联网提供所有应用程序都要使用的两种类型的服务,尽管目前理解这些服务的细节并不重要,但在所有TCP/IP概述中,都不能忽略他们: 无连接分组交付服务(Connectionless Packe ...

  2. Android 手势

    GestureDetector:手势监听类,通常在View的setOnTouchListener方法中设置TouchListener,在TouchListener的onTouch函数中把MotionE ...

  3. DataView和DefaultView的理解

    DefaultView 的作用(对DataSet查询出的来数据进行排序)(这个老哥的太长了) DefaultView:默认视图.datatable.DefaultView获取整个表的视图(就像sql查 ...

  4. php正则检测字符串由单一字符组成

    $str = 'aaa' $firstChar = substr($str , 0, 1); $pattern = "/^[$firstChar]+$/"; $ret = preg ...

  5. hiho169周 - 表达式求值

    题目链接 计算表达式100*(2+12)-(20/3)*2 ---------------------------------------------------------------------- ...

  6. 转 c#中 base64字符串与普通字符串互转

    https://blog.csdn.net/hwt0101/article/details/79758912 转成 Base64 形式的 System.String:    string a = &q ...

  7. 正则效验url

    上篇文章讲到多主题的解决方案:简单暴力的TP5多主题方案 为了简化配置,所以将域名前的协议 http/https 截取了. 后台配置时就需要效验配置的格式是否正确,需要用到的正则代码如下: /*** ...

  8. Node_进阶_6

    Node进阶第六天 一.复习 cookie是在res中设置,req中读取的.第一次的访问没有cookie. cookie的存储大小有限,kv对儿.对用户可见,用户可以禁用.清除cookie.可以被篡改 ...

  9. vue生命周期-学习心得

    每个Vue实例在被创建之前都要经过一系列的初始化过程,也就是从开始创建.初始化数据.编译模板.挂载Dom.渲染→更新→渲染.销毁等一系列过程,这个过程就是vue的生命周期. 1 vue生命周期图 {: ...

  10. php include 和require的区别与转码

    php include 和require的区别相同点:include和require 都能把另外一个文件包含到当前文件中.  不同点:使用include时,当包含的文件不存在时,系统会报出警告级别的错 ...