angular问题总结

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yyx3214/article/details/82114690

1.Cannot read property ‘config’ of null
这里写图片描述

缺少.angular-cli.json
这里写图片描述

  1. Error:Angular Compiler was detected but it was an instance of the wrong class.
    This likely means you have several @ngtools/webpack packages installed. You can check this with npm ls @ngtools/webpack, and then remove the extra copies.
    这里写图片描述
    提示有多个@ngtools/webpack
    这里写图片描述
    删除一个就可以

3.WARNING in ./src/app/login/login.component.css
(Emitted value instead of an instance of Error) postcss-import: H:\h one\src\app\login\login.component.css:110:3: @import must precede all other statements (beside
这里写图片描述

这里写图片描述
要把@import url 把这句话放到最上边注释的下边就可以了

4.ERROR in No NgModule metadata found for ‘AppModule’.
这里写图片描述
在APP module空行按下空格键就可以了

5.angular5-懒加载问题:Uncaught (in promise): TypeError: webpack_require.e is not a function TypeError: __webpack_requi
这里写图片描述

npm remove -g @angular/cli
npm install -g @angular/cli@1.7.2
npm remove @angular/cli
npm add @angular/cli@1.7.3 --save-dev

猜你喜欢

转载自blog.csdn.net/yyx3214/article/details/82114690