2017-09-18 24 views
2

我試着用因緣做測試,但得到一個錯誤:多的WebPack

ERROR in ./src/test.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. 

當我執行CMD我得到這樣的結果:

+-- @angular/[email protected] 
| `-- @ngtools/[email protected] 
`-- @ngtools/[email protected] 

在我package.json我只有@ngtools/webpack": "^1.5.1

這個1.4.1來自哪裏?

+1

答案就在你眼前。這是角度cli的一個子依賴。 –

回答

4

它來自角度cli。從包json中刪除你的。重新安裝模塊。它會起作用。

+0

沒有sse它那樣,我一定很累,謝謝 –

+0

碰巧所有人:-)沒問題 – alexKhymenko

+0

重新安裝,刪除node_modules文件夾,清除npm緩存等沒有解決它。目前我使用'「@ angular/cli」:「^ 1.7.0」''npm ls @ ngtools/webpack'只顯示一個webpack ...錯誤是:'Module build failed:Error:Angular Compiler was detected,but it是錯誤的類的一個例子。 這可能意味着您已經安裝了多個@ ngtools/webpack軟件包。 – messerbill