webpack使用loader 报错

来源:4-2 使用 babel-loader 转换 ES6 代码(上)

小小云儿

2017-05-30 15:43

怎么没一个人报错的啊!!我心里苦啊! 我一直都是 npm WARN babel-loader@7.0.0 requires a peer of webpack@2 but none was installed. npm WARN html-webpack-plugin@2.28.0 requires a peer of webpack@1 || ^2 || ^2.1.0-beta || ^2.2.0-rc but none was installed. 页面中一直是: main.bundle.js:50 Uncaught SyntaxError: Unexpected token import

写回答 关注

2回答

  • 慕斯卡7304553
    2019-08-30 10:28:39

    npm WARN babel-loader@7.0.0 requires a peer of webpack@2 but none is installed. You must install peer dependencies yourself.

    npm WARN extract-text-webpack-plugin@1.0.1 requires a peer of webpack@^1.9.11 but none is installed. You must

    install peer dependencies yourself.

    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):

    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})


  • weibo_陈杰夫长颈鹿_03237116
    2017-06-20 23:25:55

    你用的是webpack@1吧?安装webpack直接就是webpack@2(现在可能是@3了),直接npm install webpack --save-dev

    慕斯卡730...

    回复 lyhzwf遇到跟你同样问题,你解决了波

    2019-08-30 10:28:11

    共 2 条回复 >

webpack深入与实战

webpack实战教程,用真实项目带你探索 webpack 强大的功能

86561 学习 · 721 问题

查看课程

相似问题