问答详情
源自:4-2 使用 babel-loader 转换 ES6 代码(上)

webpack使用loader 报错

怎么没一个人报错的啊!!我心里苦啊! 我一直都是 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

提问者:小小云儿 2017-05-30 15:43

个回答

  • 慕斯卡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