日常填坑--gulp build出错 error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3&quo
Posted pikachuworld
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了日常填坑--gulp build出错 error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3&quo相关的知识,希望对你有一定的参考价值。
1、想通过babel-node让后端node可以运行es6,结果装完babel-cli总是报错Requires Babel "^7.0.0-0", but was loaded with "6.26.3"
yarn add @babel/cli @babel/core @babel/node @babel/preset-env -D
参考链接
https://segmentfault.com/q/1010000017876791/
要看具体的版本号,可以去 package-lock.json, 或者如果你用了yarn,那就去 yarn-lock.json 中找。
package-lock.json和
package.json的区别参考一下链接
https://www.jianshu.com/p/818833b2dd5a
网上所有的方法都尝试一下遍,以上并没有解决这个问题直到我看到这篇文章:
https://blog.csdn.net/wiki_Wei/article/details/90271435
把作者的包复制过来,重新删除安装,以上的错误没有报错但是报了js压缩的的错误
"devDependencies":
"babel-core": "^6.26.3",
"babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1",
"gulp": "^3.9.1",
"gulp-babel": "^7.0.1",
"gulp-rename": "^1.4.0",
"gulp-uglify": "^3.0.1"
于是在压缩后面加了一行代码,报错具体哪个js报错:
函数命名规范不一致
比如其他的都是A:function()唯独有一个functionA()改过来就好了,这个很奇怪的问题
以上是关于日常填坑--gulp build出错 error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3&quo的主要内容,如果未能解决你的问题,请参考以下文章
如何写一个能在gulp build pipe中任意更改src内容的函数
Node学习笔记:gulp+express+io.socket部署angularJs2(填坑篇)
ANT build.xml 编译出错Error running javac.exe compiler,详细情况如下:
cordova发布编译出错,提示:cordova-build error : Execution failed for task ':mergeReleaseResources'.或(
cordova发布编译出错,提示:cordova-build error : Execution failed for task ':mergeReleaseResources'.或(