ERROR in Entry module not found Error Can't resolve 'babel' in ' Use

本文介绍了如何使用Babel进行模块加载器的配置,重点讲解了如何设置ES6和React的预设,帮助读者理解Babel-loader的基本用法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


  //babel 的配置, ES6 与React
  module: {
    loaders: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: 'babel-loader', //修改这里, 原来写的是babel。 
        query: {
          presets: ['es2015','react']
        }
      }
    ]
  }
复制代码

个人博客: www.liangtongzhuo.com

转载于:https://juejin.im/post/5a31f18d6fb9a044fb07c603

根据配置报错PS D:\QD\vue-cli\ketepai> npm run dev > ketepai@1.0.0 dev > webpack-dev-server --inline --progress --config build/webpack.dev.conf.js (node:31036) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated. (Use `node --trace-deprecation ...` to show where the warning was created) (node:31036) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated. 10% building modules 1/1 modules 0 active Project is running at http://localhost:8080/ webpack output is served from / 95% emitting ERROR Failed to compile with 1 errors 11:03:47 This relative module was not found: * ./src/index.js in multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/index.js Hash: bf5afe77233399ef319a Version: webpack 3.12.0 Time: 250ms Asset Size Chunks Chunk Names bundle.js 424 kB 0 [emitted] [big] main [17] multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/index.js 52 bytes {0} [built t] [18] (webpack)-dev-server/client?http://localhost:8080 7.93 kB {0} [built] [19] ./node_modules/url/url.js 23.5 kB {0} [built] [20] ./node_modules/punycode/punycode.js 14.7 kB {0} [built] [22] ./node_modules/qs/lib/index.js 211 bytes {0} [built] [53] ./node_modules/strip-ansi/index.js 161 bytes {0} [built] [54] ./node_modules/ansi-regex/index.js 135 bytes {0} [built] [55] ./node_modules/loglevel/lib/loglevel.js 11.3 kB {0} [built] [56] (webpack)-dev-server/client/socket.js 1.08 kB {0} [built] [57] ./node_modules/sockjs-client/dist/sockjs.js 181 kB {0} [built] [58] (webpack)-dev-server/client/overlay.js 3.67 kB {0} [built] [59] ./node_modules/ansi-html/index.js 4.26 kB {0} [built] [68] (webpack)/hot/dev-server.js 1.61 kB {0} [built] + 54 hidden modules ERROR in multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/index.js Module not found: Error: Can't resolve './src/index.js' in 'D:\QD\vue-cli\ketepai' @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/index.js webpack: Failed to compile.
最新发布
08-11
umi3.5.20构建react项目,axios从0.24.0升级到1.6.8后,本地运行报错,报错内容如下ERROR in ./node_modules/axios/lib/utils.js 3:0-157 Module not found: Error: Can’t resolve ‘D:/dp-project/memberAirport-saas-web/node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray’ in ‘D:\dp-project\memberAirport-saas-web\node_modules\axios\lib’ Did you mean ‘slicedToArray.js’? BREAKING CHANGE: The request ‘D:/dp-project/memberAirport-saas-web/node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray’ failed to resolve only because it was resolved as fully specified (probably because the origin is a '.mjs’ file or a ‘*.js’ file where the package.json contains ‘“type”:module”’). The extension in the request is mandatory for it to be fully specified. Add the extension to the request. @ ./node_modules/axios/lib/axios.js 3:0-31 32:2-14 36:2-14 74:24-40 @ ./node_modules/axios/index.js 1:0-35 5:12-23 6:17-33 7:20-39 8:15-29 9:18-35 10:14-27 11:10-19 12:13-25 13:19-37 14:13-25 15:17-33 16:19-37 17:21-41 18:17-33 19:17-33 20:18-35 21:0-208 @ ./src/.umi/.cache/.mfsu/mf-va_axios.js 1:0-22 2:15-16 3:0-22 3:0-22 @ container entry ./axios[0] webpack compiled with 31 errors null Error: build failed at D:\dp-project\memberAirport-saas-web\node_modules@umijs\bundler-webpack\lib\index.js:172:29 at D:\dp-project\memberAirport-saas-web\node_modules@umijs\deps\compiled\webpack\5\bundle5.js:114591:14 at processQueueWorker (D:\dp-project\memberAirport-saas-web\node_modules@umijs\deps\compiled\webpack\5\bundle5.js:114529:6) at processTicksAndRejections (node:internal/process/task_queues:78:11)
03-10
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值