美文网首页我爱编程
Angular报错记录 - TypeError: Cannot

Angular报错记录 - TypeError: Cannot

作者: 飞鱼YE | 来源:发表于2018-02-01 20:10 被阅读0次

    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

    相关文章

      网友评论

        本文标题:Angular报错记录 - TypeError: Cannot

        本文链接:https://www.haomeiwen.com/subject/psydzxtx.html