找不到输入模块:错误:无法解析&hbsp-html-webpack-plugin / lib / loader.j s'

时间:2017-01-26 16:04:49

标签: heroku webpack angular-cli

我已从angular-cli@1.0.0-beta.21升级到angular-cli@1.0.0-beta.25.5,进行了所有必要的更改,以便我的应用成功运行ng serve。但是,当我尝试部署到Heroku时,它会因下面的奇怪错误而失败。

remote:        ERROR in   Error: Child compilation failed:
remote:        Entry module not found: Error: Can't resolve 'html-webpack-plugin/lib/loader.j  s' in '/tmp/build_7c419ad06257b748ec6f7c819360bd4b':
remote:        Error: Can't resolve 'html-webpack-plugin/lib/loader.js' in '/tmp/build_7c419a  d06257b748ec6f7c819360bd4b'
remote:        
remote:        - compiler.js:76
remote:        [lib]/[angular-cli]/[html-webpack-plugin]/lib/compiler.js:76:16
remote:        
remote:        - Compiler.js:280 Compiler.<anonymous>
remote:        [lib]/[angular-cli]/[webpack]/lib/Compiler.js:280:10
remote:        
remote:        - Compiler.js:480
remote:        [lib]/[angular-cli]/[webpack]/lib/Compiler.js:480:13
remote:        
remote:        - Tapable.js:138 next
remote:        [lib]/[angular-cli]/[tapable]/lib/Tapable.js:138:11
remote:        
remote:        - CachePlugin.js:62 Compiler.<anonymous>
remote:        [lib]/[angular-cli]/[webpack]/lib/CachePlugin.js:62:5
remote:        
remote:        - Tapable.js:142 Compiler.applyPluginsAsyncSeries
remote:        [lib]/[angular-cli]/[tapable]/lib/Tapable.js:142:13
remote:        
remote:        - Compiler.js:477
remote:        [lib]/[angular-cli]/[webpack]/lib/Compiler.js:477:10
remote:        
remote:        - Tapable.js:138 next
remote:        [lib]/[angular-cli]/[tapable]/lib/Tapable.js:138:11
remote:        
remote:        - suppress-entry-chunks-webpack-plugin.js:38 Compilation.<anonymous>
remote:        [lib]/[angular-cli]/plugins/suppress-entry-chunks-webpack-plugin.js:38:17
remote:        
remote:        - Tapable.js:142 Compilation.applyPluginsAsyncSeries
remote:        [lib]/[angular-cli]/[tapable]/lib/Tapable.js:142:13
remote:        
remote:        - Compilation.js:615 self.applyPluginsAsync.err
remote:        [lib]/[angular-cli]/[webpack]/lib/Compilation.js:615:19
remote:        
remote:        - Tapable.js:131 Compilation.applyPluginsAsyncSeries
remote:        [lib]/[angular-cli]/[tapable]/lib/Tapable.js:131:46
remote:        
remote:        - Compilation.js:606 self.applyPluginsAsync.err
remote:        [lib]/[angular-cli]/[webpack]/lib/Compilation.js:606:11
remote:        
remote:        - Tapable.js:138 next
remote:        [lib]/[angular-cli]/[tapable]/lib/Tapable.js:138:11
remote:        
remote:        - UglifyJsPlugin.js:140 Compilation.compilation.plugin
remote:        [lib]/[angular-cli]/[webpack]/lib/optimize/UglifyJsPlugin.js:140:5
remote:        
remote:        - Tapable.js:142 Compilation.applyPluginsAsyncSeries
remote:        [lib]/[angular-cli]/[tapable]/lib/Tapable.js:142:13
remote:        
remote:        - Compilation.js:601 self.applyPluginsAsync.err
remote:        [lib]/[angular-cli]/[webpack]/lib/Compilation.js:601:10
remote:        
remote:        - Tapable.js:131 Compilation.applyPluginsAsyncSeries
remote:        [lib]/[angular-cli]/[tapable]/lib/Tapable.js:131:46
remote:        
remote:        - Compilation.js:597 sealPart2
remote:        [lib]/[angular-cli]/[webpack]/lib/Compilation.js:597:9
remote:        
remote:        - Tapable.js:131 Compilation.applyPluginsAsyncSeries
remote:        [lib]/[angular-cli]/[tapable]/lib/Tapable.js:131:46
remote:        
remote:        - Compilation.js:545 Compilation.seal
remote:        [lib]/[angular-cli]/[webpack]/lib/Compilation.js:545:8
remote:        
remote:        - Compiler.js:474
remote:        [lib]/[angular-cli]/[webpack]/lib/Compiler.js:474:16
remote:        
remote:        - Tapable.js:225
remote:        [lib]/[angular-cli]/[tapable]/lib/Tapable.js:225:11
remote:        
remote:        - Compilation.js:452 _addModuleChain
remote:        [lib]/[angular-cli]/[webpack]/lib/Compilation.js:452:11
remote:        
remote:        - Compilation.js:345 Compilation.errorAndCallback
remote:        [lib]/[angular-cli]/[webpack]/lib/Compilation.js:345:4
remote:        
remote:        - Compilation.js:362 moduleFactory.create
remote:        [lib]/[angular-cli]/[webpack]/lib/Compilation.js:362:12
remote:        
remote:        - NormalModuleFactory.js:234
remote:        [lib]/[angular-cli]/[webpack]/lib/NormalModuleFactory.js:234:19
remote:        
remote:        - NormalModuleFactory.js:59 onDoneResolving
remote:        [lib]/[angular-cli]/[webpack]/lib/NormalModuleFactory.js:59:20
remote:        
remote:        - NormalModuleFactory.js:126
remote:        [lib]/[angular-cli]/[webpack]/lib/NormalModuleFactory.js:126:20
remote:        
remote:        - async.js:3694
remote:        [lib]/[angular-cli]/[async]/dist/async.js:3694:9
remote:        
remote:        - async.js:356
remote:        [lib]/[angular-cli]/[async]/dist/async.js:356:16
remote:        
remote:        - async.js:934 iteratorCallback
remote:        [lib]/[angular-cli]/[async]/dist/async.js:934:13
remote:        
remote:        - async.js:840
remote:        [lib]/[angular-cli]/[async]/dist/async.js:840:16
remote:        
remote:        - async.js:3691
remote:        [lib]/[angular-cli]/[async]/dist/async.js:3691:13
remote:        
remote:        - async.js:21 apply
remote:        [lib]/[angular-cli]/[async]/dist/async.js:21:25
remote:        
remote:        - async.js:56
remote:        [lib]/[angular-cli]/[async]/dist/async.js:56:12
remote:        
remote:        - async.js:1013
remote:        [lib]/[angular-cli]/[async]/dist/async.js:1013:9
remote:        
remote:        - async.js:356
remote:        [lib]/[angular-cli]/[async]/dist/async.js:356:16
remote:        
remote:        - async.js:934 iteratorCallback
remote:        [lib]/[angular-cli]/[async]/dist/async.js:934:13
remote:        
remote:        - async.js:840
remote:        [lib]/[angular-cli]/[async]/dist/async.js:840:16
remote:        
remote:        - async.js:1010
remote:        [lib]/[angular-cli]/[async]/dist/async.js:1010:13
remote:        
remote:        - NormalModuleFactory.js:262
remote:        [lib]/[angular-cli]/[webpack]/lib/NormalModuleFactory.js:262:19
remote:        
remote:        - Resolver.js:70 onResolved
remote:        [lib]/[angular-cli]/[webpack]/[enhanced-resolve]/lib/Resolver.js:70:11
remote:        
remote:        - createInnerCallback.js:31 loggingCallbackWrapper
remote:        [lib]/[angular-cli]/[webpack]/[enhanced-resolve]/lib/createInnerCallback.js:    31:19
remote:        
remote:        - Resolver.js:138 afterInnerCallback
remote:        [lib]/[angular-cli]/[webpack]/[enhanced-resolve]/lib/Resolver.js:138:10
remote:        
remote:        - createInnerCallback.js:31 loggingCallbackWrapper
remote:        [lib]/[angular-cli]/[webpack]/[enhanced-resolve]/lib/createInnerCallback.js:    31:19
remote:        
remote:        - Tapable.js:181 Resolver.applyPluginsAsyncSeriesBailResult1
remote:        [lib]/[angular-cli]/[tapable]/lib/Tapable.js:181:46
remote:        
remote:        - Resolver.js:125 innerCallback
remote:        [lib]/[angular-cli]/[webpack]/[enhanced-resolve]/lib/Resolver.js:125:19
remote:        
remote:        - createInnerCallback.js:31 loggingCallbackWrapper
remote:        [lib]/[angular-cli]/[webpack]/[enhanced-resolve]/lib/createInnerCallback.js:    31:19
remote:        
remote:        - Tapable.js:283
remote:        [lib]/[angular-cli]/[tapable]/lib/Tapable.js:283:15
remote:        
remote:        - UnsafeCachePlugin.js:39
remote:        [lib]/[angular-cli]/[webpack]/[enhanced-resolve]/lib/UnsafeCachePlugin.js:39    :4
remote:        
remote:        

我对Angular CLI和WebPack(以及朋友)的内部知之甚少,所以我不清楚这是否是webpack或html-webpack-plugin问题。任何想法???

备注:

  • package.json语法有效;
  • ng serve适用于本地Linux机器;
  • ng serve --prod适用于本地Linux机器;
  • 添加html-webpack-plugin依赖项不会改变任何内容;
  • 添加webpack依赖项不会改变任何内容;
  • 项目文件都是UNIX编码的;
  • html-webpack-plugin@2.26.0;
  • webpack@2.2.0;
  • @ngtools/webpack@1.2.4;

1 个答案:

答案 0 :(得分:0)

更新至html-webpack-plugin@2.28.0或更高。

这是html-webpack-plugin@2.25.0中无意中引入的错误;有关详细信息,请参阅HTML Webpack Plugin #555