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

为什么出现这种BUG

ERROR in Entry module not found: Error: Can't resolve 'babel' in 'D:\趣丸\WebPack\webpack-demo'

BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders.

                 You need to specify 'babel-loader' instead of 'babel'.


ERROR in   Error: Child compilation failed:

  Module not found: Error: Can't resolve 'babel' in 'D:\趣丸\WebPack\webpack-demo'  BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when usin  g loaders.

                   You need to specify 'babel-loader' instead of 'babel'.:

  Error: Can't resolve 'babel' in 'D:\趣丸\WebPack\webpack-demo'

  BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when usin  g loaders.

                   You need to specify 'babel-loader' instead of 'babel'.


  - compiler.js:76

    [webpack-demo]/[html-webpack-plugin]/lib/compiler.js:76:16


  - Compiler.js:280 Compiler.<anonymous>

    [webpack-demo]/[webpack]/lib/Compiler.js:280:10


  - Compiler.js:480

    [webpack-demo]/[webpack]/lib/Compiler.js:480:13


  - Tapable.js:138 next

    [webpack-demo]/[tapable]/lib/Tapable.js:138:11


  - CachePlugin.js:62 Compiler.<anonymous>

    [webpack-demo]/[webpack]/lib/CachePlugin.js:62:5


  - Tapable.js:142 Compiler.applyPluginsAsyncSeries

    [webpack-demo]/[tapable]/lib/Tapable.js:142:13


  - Compiler.js:477

    [webpack-demo]/[webpack]/lib/Compiler.js:477:10


  - Tapable.js:131 Compilation.applyPluginsAsyncSeries

    [webpack-demo]/[tapable]/lib/Tapable.js:131:46


  - Compilation.js:640

    [webpack-demo]/[webpack]/lib/Compilation.js:640:19


  - Tapable.js:131 Compilation.applyPluginsAsyncSeries

    [webpack-demo]/[tapable]/lib/Tapable.js:131:46


  - Compilation.js:631

    [webpack-demo]/[webpack]/lib/Compilation.js:631:11


  - Tapable.js:131 Compilation.applyPluginsAsyncSeries

    [webpack-demo]/[tapable]/lib/Tapable.js:131:46


  - Compilation.js:626

    [webpack-demo]/[webpack]/lib/Compilation.js:626:10


  - Tapable.js:131 Compilation.applyPluginsAsyncSeries

    [webpack-demo]/[tapable]/lib/Tapable.js:131:46


  - Compilation.js:622 sealPart2

    [webpack-demo]/[webpack]/lib/Compilation.js:622:9


  - Tapable.js:131 Compilation.applyPluginsAsyncSeries

    [webpack-demo]/[tapable]/lib/Tapable.js:131:46


  - Compilation.js:570 Compilation.seal

    [webpack-demo]/[webpack]/lib/Compilation.js:570:8


  - Compiler.js:474

    [webpack-demo]/[webpack]/lib/Compiler.js:474:16


  - Tapable.js:225

    [webpack-demo]/[tapable]/lib/Tapable.js:225:11


  - Compilation.js:472

    [webpack-demo]/[webpack]/lib/Compilation.js:472:11


  - Compilation.js:443

    [webpack-demo]/[webpack]/lib/Compilation.js:443:13


  - next_tick.js:67 _combinedTickCallback

    internal/process/next_tick.js:67:7


  - next_tick.js:98 process._tickCallback

    internal/process/next_tick.js:98:9



Child html-webpack-plugin for "index.html":

       [0] ./~/html-webpack-plugin/lib/loader.js!./index.html 508 bytes {0} [built]


    ERROR in ./~/html-webpack-plugin/lib/loader.js!./index.html

    Module not found: Error: Can't resolve 'babel' in 'D:\趣丸\WebPack\webpack-demo'

    BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders.

                     You need to specify 'babel-loader' instead of 'babel'.

     @ ./~/html-webpack-plugin/lib/loader.js!./index.html 1:8-50


npm ERR! Windows_NT 6.1.7601

npm ERR! argv "D:\\nodeJS\\node.exe" "C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "webpack"

npm ERR! node v5.10.1

npm ERR! npm  v4.1.2

npm ERR! code ELIFECYCLE

npm ERR! webpack-demo@1.0.0 webpack: `webpack --config webpack.config.js --progress --display-modules --colors`

npm ERR! Exit status 2

npm ERR!

npm ERR! Failed at the webpack-demo@1.0.0 webpack script 'webpack --config webpack.config.js --progress --display-modules --colors'.

npm ERR! Make sure you have the latest version of node.js and npm installed.

npm ERR! If you do, this is most likely a problem with the webpack-demo package,

npm ERR! not with npm itself.

npm ERR! Tell the author that this fails on your system:

npm ERR!     webpack --config webpack.config.js --progress --display-modules --colors

npm ERR! You can get information on how to open an issue for this project with:

npm ERR!     npm bugs webpack-demo

npm ERR! Or if that isn't available, you can get their info via:

npm ERR!     npm owner ls webpack-demo

npm ERR! There is likely additional logging output above.


npm ERR! Please include the following file with any support request:

npm ERR!     D:\趣丸\WebPack\webpack-demo\npm-debug.log


正在回答

7 回答

You need to specify 'babel-loader' instead of 'babel'. 
他这里说了,你用的是什么版本?

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

不浪漫

这不是老师吗 是不是该弄点收费课程了,感觉同学们webpack也学的差不多了
2017-05-10 回复 有任何疑惑可以回复我~
#2

严寒对酷暑

老师,这是在哪里修改,我找不到
2018-01-11 回复 有任何疑惑可以回复我~

loader: 'babel', 改成 loader: 'babel-loader',

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

我也是这个错

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

 loader: 'babel', 改成了 loader: 'babel-loader',

依然报这个错

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

UncleHu

你解决了吗?我也是这个错
2017-09-27 回复 有任何疑惑可以回复我~

webpack2要求必须加-loader了


 loader: 'babel', 改成 loader: 'babel-loader',

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

webpack2要求必须加-loader了

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

配置的loader名称改为下面的就行了

  loader: 'babel-loader',

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

严寒对酷暑

是什么意思,在哪里修改?
2018-01-11 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

为什么出现这种BUG

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