为了账号安全,请及时绑定邮箱和手机立即绑定

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

正在回答

2 回答

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"})


0 回复 有任何疑惑可以回复我~

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

0 回复 有任何疑惑可以回复我~
#1

lyhzwf

我要安装的插件用的是webpack@1,我本地是webpack@2,提示这个错误,然后我在把本地的换成webpack@1.还是一样的错,麻烦请教是什么问题
2018-03-23 回复 有任何疑惑可以回复我~
#2

慕斯卡7304553

回复 lyhzwf遇到跟你同样问题,你解决了波
2019-08-30 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

webpack使用loader 报错

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信