昨天,今天,明天,每天的每天,你是否都多懂得一点点...

星期五, 四月 06, 2018

A Strange angular prod build issue

Solution:

ncu -u
npm remove webpack
npm install webpack@3.11.0


Scenario:

ng build --prod

@angular/compiler-cli@5.2.9 requires typescript@'>=2.4.2 <2.7.0' but 2.8.1 was found instead.
Using this version can result in undefined behaviour and difficult to debug problems.

Please run the following command to install a compatible version of TypeScript.

    npm install typescript@'>=2.4.2 <2.7.0'

To disable this warning run "ng set warnings.typescriptMismatch=false".

  0% compiling
An error occured during the build:
TypeError: Cannot read property 'thisCompilation' of undefined
    at NodeTemplatePlugin.apply (c:\Users\dengy\gitLocal\tarantula\Tarantula\node_modules\webpack\lib\node\NodeTemplatePlugin.js:19:17)
    at Compiler.apply (c:\Users\dengy\gitLocal\tarantula\Tarantula\node_modules\tapable\lib\Tapable.js:375:16)
    at Object.compileTemplate (c:\Users\dengy\gitLocal\tarantula\Tarantula\node_modules\html-webpack-plugin\lib\compiler.js:48:17)
    at Compiler.<anonymous> (c:\Users\dengy\gitLocal\tarantula\Tarantula\node_modules\html-webpack-plugin\index.js:47:40)
    at Compiler.applyPluginsParallel (c:\Users\dengy\gitLocal\tarantula\Tarantula\node_modules\tapable\lib\Tapable.js:293:14)
    at applyPluginsAsync.err (c:\Users\dengy\gitLocal\tarantula\Tarantula\node_modules\@angular\cli\node_modules\webpack\lib\Compiler.js:499:9)
    at Compiler.applyPluginsAsyncSeries (c:\Users\dengy\gitLocal\tarantula\Tarantula\node_modules\tapable\lib\Tapable.js:195:46)
    at Compiler.compile (c:\Users\dengy\gitLocal\tarantula\Tarantula\node_modules\@angular\cli\node_modules\webpack\lib\Compiler.js:492:8)
    at readRecords.err (c:\Users\dengy\gitLocal\tarantula\Tarantula\node_modules\@angular\cli\node_modules\webpack\lib\Compiler.js:279:11)
    at Compiler.readRecords (c:\Users\dengy\gitLocal\tarantula\Tarantula\node_modules\@angular\cli\node_modules\webpack\lib\Compiler.js:391:11)
    at applyPluginsAsync.err (c:\Users\dengy\gitLocal\tarantula\Tarantula\node_modules\@angular\cli\node_modules\webpack\lib\Compiler.js:276:10)
    at next (c:\Users\dengy\gitLocal\tarantula\Tarantula\node_modules\tapable\lib\Tapable.js:202:11)
    at Compiler.compiler.plugin (c:\Users\dengy\gitLocal\tarantula\Tarantula\node_modules\@angular\cli\node_modules\webpack\lib\CachePlugin.js:51:59)
    at Compiler.applyPluginsAsyncSeries (c:\Users\dengy\gitLocal\tarantula\Tarantula\node_modules\tapable\lib\Tapable.js:206:13)
    at applyPluginsAsync.err (c:\Users\dengy\gitLocal\tarantula\Tarantula\node_modules\@angular\cli\node_modules\webpack\lib\Compiler.js:273:9)
    at next (c:\Users\dengy\gitLocal\tarantula\Tarantula\node_modules\tapable\lib\Tapable.js:202:11)
Cannot read property 'thisCompilation' of undefined




--
Feng

没有评论:

其它博客地址

此博客的同步博客地址: http://fengnz.wordpress.com
这里进入我的MSN SPACE.