今天把远程仓库拉下项目,运行'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. .Net垃圾回收和大对象处理

    本文引自:http://www.cnblogs.com/yukaizhao/archive/2011/11/21/dot_net_gc_large_object_heap.html CLR垃圾回收器根 ...

  2. 你不知道的JavaScript(十)with关键字

    with关键字在JavaScript中不太常用,用来定义一个和对象相关的作用域,在该作用域中可以访问对象的属性或方法而前面无需加上对象名,以达到简化代码的目的. <script type=&qu ...

  3. 《鸟哥的Linux私房菜》笔记——02. 关于Linux

    Unix 历史 1969年以前:伟大的梦想--Bell, MIT 与 GE 的「Multics」系统 1969年:Ken Thompson 的小型 file server system 1973年:U ...

  4. HDU 1312 Red and Black【DFS】

    搜索虐我千万遍@_@-----一道搜索的水题,WA了好多好多次@_@发现是n,m搞反了-_- 题意-- 给出m行 n列的矩形,其中从@出发,不能跳到#,只能跳到'.'问最多能够跳到多少块'.' 直接搜 ...

  5. VB学习笔记(一)VB操作字符串

    在vb中 dim a# 定义a变量为双精度型变量~ #是类型符 % 整型 & 长整型 !单精度 $ 字符型 VB中strconv 的作用 StrConv("要转换的字符串" ...

  6. 如何发布到NPM上(转)

    简要:这篇文章介绍了如何讲自己的包发布到NPM上,马克一下,将来有用 ... npm包发布 发布npm包,更方便以后下载使用. 我们已经把插件代码上传到github上面了,那么我们是否可以也做成一个n ...

  7. sql知识小记

    1.在sql语句中,单引号嵌套时,使用单引号做转义

  8. Centos7&docker-ce&compose&wordpress

    如题,最近帮人装个WordPress,想起来用docker方便,这里做个记录. 原文:https://my.oschina.net/finchxu/blog/2877580 因为docker要求lin ...

  9. C语言中头文件尖括号和引号的区别

    用include 引用头文件时,双引号和尖括号的区别: 1.双引号:引用非标准库的头文件,编译器首先在程序源文件所在目录查找,如果未找到,则去系统默认目录查找,通常用于引用用户自定义的头文件. 2.尖 ...

  10. 【codeforces 429D】Tricky Function

    [题目链接]:http://codeforces.com/problemset/problem/429/D [题意] 给你n个数字; 让你求出一段区间[l,r] 使得 (r−l)2+(∑rl+1a[i ...