Although this question has been asked before, I have exhausted all possible solutions that were suggested. Unfortunately, I still cannot resolve it on my own. Any assistance would be greatly appreciated.
Error:
ERROR in ./src/main.ts
Module build failed: Error: Angular Compiler was detected but it was an instance of the wrong class.
This could indicate that you have multiple @ngtools/webpack packages installed. You can verify this by using `npm ls @ngtools/webpack` and then removing any additional copies.
at Object.ngcLoader (C:\WORK\folder\folder\folder\node_modules\@ngtools\webpack\src\loader.js:33:15)
@ multi ./src/main.ts
ERROR in ./src/polyfills.ts
Module build failed: Error: Angular Compiler was detected but it was an instance of the wrong class.
This could indicate that you have multiple @ngtools/webpack packages installed. You can verify this by using `npm ls @ngtools/webpack` and then removing any additional copies.
at Object.ngcLoader (C:\WORK\folder\folder\folder\node_modules\@ngtools\webpack\src\loader.js:33:15)
@ multi ./src/polyfills.ts
ERROR in Error: No NgModule metadata found for 'AppModule'.
at NgModuleResolver.resolve (C:\WORK\folder\folder\folder\node_modules\@angular\compiler\bundles\compiler.umd.js:20291:23)
at CompileMetadataResolver.getNgModuleMetadata (C:\WORK\folder\folder\folder\node_modules\@angular\compiler\bundles\compiler.umd.js:15244:60)
...
Configuration:
Angular CLI: 1.7.0-beta.2
Node: 8.9.4
OS: win32 x64
Angular: 5.2.11
...
--- Package.json ---
{
"name": "app1",
"version": "0.0.0",
"license": "MIT",
...
}
---
I have tried various methods to solve this issue, including:
- Deleting the node_module folder and Package.lock.json
- Reinstalling npm with `npm install`
- Updating npm with `npm update`
Any guidance on what I might be missing would be highly appreciated as I am currently stuck.
---------------------------------
After conducting extensive research, I managed to resolve this problem by making changes to the package.json file as follows:
{
"name": "app1",
"version": "0.0.0",
"license": "MIT",
...
}
However, there is still one remaining issue:
ERROR in No NgModule metadata found for 'AppModule'.
If anyone could provide assistance with this, it would be greatly appreciated.