Angular报错记录 - TypeError: Cannot read property 'NullLogger' of undefined

Angular CLI 1.4.3 创建组件时报错

Cannot read property 'NullLogger' of undefined
TypeError: Cannot read property 'NullLogger' of undefined
    at SchematicEngine.createContext (D:\work\retail-scan\node_modules\@angular-devkit\schematics\src\engine\engine.js:75:38)
    at SchematicImpl.call (D:\work\retail-scan\node_modules\@angular-devkit\schematics\src\engine\schematic.js:35:38)
    at Promise (D:\work\retail-scan\node_modules\@angular\cli\tasks\schematic-run.js:77:23)
    at Class.run (D:\work\retail-scan\node_modules\@angular\cli\tasks\schematic-run.js:76:16)
    at Class.run (D:\work\retail-scan\node_modules\@angular\cli\commands\generate.js:148:33)
    at resolve (D:\work\retail-scan\node_modules\@angular\cli\ember-cli\lib\models\command.js:273:20)
    at Class.validateAndRun (D:\work\retail-scan\node_modules\@angular\cli\ember-cli\lib\models\command.js:251:12)
    at Promise.resolve.then.then (D:\work\retail-scan\node_modules\@angular\cli\ember-cli\lib\cli\cli.js:154:24)

多次测试发现是因为node_modules下的@angular-devkit安装失败导致的,使用淘宝代理或从其他安装成功的项目拷贝该文件夹可解决

image.png

推荐阅读更多精彩内容