gpt4 book ai didi

javascript - 模块构建失败 : Error: AotPlugin was detected but it was an instance of the wrong class

转载 作者:搜寻专家 更新时间:2023-10-30 21:50:10 25 4
gpt4 key购买 nike

我尝试将 webpack 升级到最新版本,因为在运行 angular 应用程序时旧版本中的实时重新加载存在问题。在前面的场景中,一切正常,我只是遇到了实时重新加载的问题。所以我把它升级到最新版本的webpack,在老版本webpack的issue中说的。

所以当我把它升级到最新版本时。我现在在运行 ng serve 时遇到了这个错误。

ERROR in ./src/main.ts Module build failed: Error: AotPlugin 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. at Object.ngcLoader (/home/jayzdevera/Documents/ad-fingerprinting/web/node_modules/@ngtools/webpack/src/loader.js:430:19) @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts ERROR in ./src/polyfills.ts Module build failed: Error: AotPlugin 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. at Object.ngcLoader (/home/jayzdevera/Documents/ad-fingerprinting/web/node_modules/@ngtools/webpack/src/loader.js:430:19) @ multi ./src/polyfills.ts

npm ls @ngtools/webpack

@angular/cli@1.3.2
│ └── @ngtools/webpack@1.6.2
└── @ngtools/webpack@1.6.2

我正在使用 Ubuntu 16.04

如果有人能提供帮助,我们将不胜感激。提前致谢。

最佳答案

我最近在@angular/cli@1.4.9 和@ngtools/webpack@1.7.4 上遇到了类似的问题

├─┬ @angular/cli@1.4.9
│ └── @ngtools/webpack@1.7.4
└── @ngtools/webpack@1.7.4

按照此处的说明进行操作 https://github.com/angular/angular-cli/wiki/stories-1.0-update

npm uninstall -g angular-cli
npm uninstall --save-dev angular-cli

npm uninstall -g @angular/cli
npm uninstall --save-dev @angular/cli

rm -rf node_modules dist
npm cache clean

npm install -g @angular/cli@latest
npm install --save-dev @angular/cli@latest
npm install

关于javascript - 模块构建失败 : Error: AotPlugin was detected but it was an instance of the wrong class,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46188636/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com