angular编译出错解决办法Angular Compiler was detected but it was an instance of the wrong class.

来源:互联网 发布:欧美衣服淘宝 编辑:程序博客网 时间:2024/06/05 17:37

出现如下错误:
错误信息

Module build failed: 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包,你可以使用npm ls @ngtools/webpack命令来检查,然后删除多余的副本。

npm ls @ngtools/webpack

果然有两个版本

提示@ngtools/webpack@1.8.0版本是多于的,然后去目录下面把它删掉,问题解决。

阅读全文
0 0
原创粉丝点击