I have an angular project that runs normally in the production environment, but I'm wanting to build it and I'm getting the following error when using the npm run build command:
ERROR in Error: Type ImageCropperComponent in C: / d / Workspaces / Course Java Workspace / pk2-angular-v1.0.0 / node_modules / ng2-img-cropper / src / imageCropperComponent.d.ts is part of the declarations of 2 modules: AppModule in C: / d / Workspaces / Java Course Workspace / pk2-angular-v1.0.0 / src / app / app.module.ts and ImageCropperModule in C: / d / Workspaces / Java Course Workspace / pk2-angular-v1.0.0 / node_modules / ng2-img-cropper / src / imageCropperModule.d.ts! Please consider moving ImageCropperComponent in C: / d / Workspaces / Course Java Workspace / pk2-angular-v1.0.0 / node_modules / ng2-img-cropper / src / imageCropperComponent.d.ts to a higher module that imports AppModule in C: / d / Workspaces / Course Java Workspace / pk2-angular-v1.0.0 / src / app / app.module.ts and ImageCropperModule in C: / d / Workspaces / Java Course Workspace / pk2-angular-v1.0.0 / node_modules / ng2-img-cropper / src / imageCropperModule.d.ts. You can also create a new NgModule that exports and includes ImageCropperComponent in C: / d / Workspaces / Java Course Workspace / pk2-angular-v1.0.0 / node_modules / ng2-img-cropper / src / imageCropperComponent.d.ts then import that NgModule in AppModule in C: / d / Workspaces / Java Course Workspace / pk2-angular-v1.0.0 / src / app / app.module.ts and ImageCropperModule in C: / d / Workspaces / Java Course Workspace / pk2-angular-v1.0.0 / node_modules / ng2-img-cropper / src / imageCropperModule.d.ts.
When reading the error I saw that this lib I am using is part of the declaration of two modules (I did not understand what that means) but come on. in my app.module that accuses the error I'm importing it:
import { ImageCropperComponent } from 'ng2-img-cropper';
and stated in my declarations so @NgModule. Can someone tell me how to solve it?