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

出现如下错误:


angular编译出错解决办法Angular Compiler was detected but it was an instance of the wrong class._第1张图片
错误信息
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/[email protected]版本是多于的,然后去目录下面把它删掉,问题解决。

你可能感兴趣的:(angular编译出错解决办法Angular Compiler was detected but it was an instance of the wrong class.)