Module build failed (from ./node_modules/babel-loader/lib/index.js):报错解决方案
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Module build failed (from ./node_modules/babel-loader/lib/index.js):报错解决方案相关的知识,希望对你有一定的参考价值。
参考技术A 这个问题困扰了我半天,一直弄不明白是什么错了,后来发现,是babel冲突了
解决方案
升级版本就可以了
npm install -D babel-loader @babel/core @babel/preset-env @babel/preset-react webpack
或者降低版本
npm install -D babel-loader@7 babel-core babel-preset-env webpack
Module build failed (from ./node_modules/source-map-loader/dist/cjs.js): TypeError: this.getOptions
错误图示如下
执行 npm run build 的时候报错
查了很久的资料只需要修改 webpack.config.js 中的rules
修改如下
以上是关于Module build failed (from ./node_modules/babel-loader/lib/index.js):报错解决方案的主要内容,如果未能解决你的问题,请参考以下文章
Module build failed (from ./node_modules/source-map-loader/dist/cjs.js): TypeError: this.getOptions
Module build failed (from ./node_modules/source-map-loader/dist/cjs.js): TypeError: this.getOptions
Module build failed (from ./node_modules/sass-loader/lib/loader.js): Cannot find module ‘node-sass‘(
Module build failed (from ./node_modules/sass-loader/lib/loader.js): Cannot find module ‘node-sass‘(
webpack报错:Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find mo
Module build failed (from ./node_modules/_sass-loader@12.3.0@sass-loader/dist/cjs.js): TypeError: