material2-carousel icon indicating copy to clipboard operation
material2-carousel copied to clipboard

Could not resolve dependency

Open mohamadkhalil88 opened this issue 3 years ago • 4 comments

i am receiving this error when running npm i (Angular 13):

While resolving: [email protected]
npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/material
npm ERR!   @angular/material@"13.1.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/material@"^10.0.1" from @ngbmodule/[email protected]
npm ERR! node_modules/@ngbmodule/material-carousel
npm ERR!   @ngbmodule/material-carousel@"0.7.2" from the root project

i had to use --force to make it work temporary, it is better to be fixed from package itself.

mohamadkhalil88 avatar Jan 21 '22 11:01 mohamadkhalil88

I have the same even with 11th version

npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/material
npm ERR!   @angular/material@"^11.2.4" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/material@"^10.0.1" from @ngbmodule/[email protected]
npm ERR! node_modules/@ngbmodule/material-carousel
npm ERR!   @ngbmodule/material-carousel@"^0.7.1" from the root project

I wonder how did it work before, because it did, but anyway, after NodeJS reinstallation I have this error. Maybe someone has already met and has resolved such confuse, thanks

ysrepo avatar Jan 25 '22 12:01 ysrepo

@gabrielbusarello any updates on your side?

mohamadkhalil88 avatar Feb 01 '22 11:02 mohamadkhalil88

It's the typescript module description. Change the import to

import { ModuleWithProviders } from '@angular/core';

and change the forRoot() Line to

    static forRoot(): (ModuleWithProviders<MatCarouselModule>)&{ngModule:MatCarouselModule};

More on this here: https://angular.io/guide/migration-module-with-providers

This worked when I made these changes in node_modules. However, the module descriptor is probably automatically generated, so changes would have to be made in projects/carousel/src/lib/carousel.module.ts.

MixusMinimax avatar Feb 13 '22 12:02 MixusMinimax

it helps locally but I need it fixed in the ngbmodule/material carousel because when I build my docker image or run a pipeline in Azure the error is still there :( When will it be fixed?

mm-pbr avatar Sep 08 '22 09:09 mm-pbr