MurhafSousli / ngx-gallery

Angular Gallery, Carousel and Lightbox
https://ngx-gallery.netlify.app/
MIT License
604 stars 128 forks source link

cant install it -new to angular- #598

Closed peyman-hakemi closed 8 months ago

peyman-hakemi commented 8 months ago

i want to install these packages in my angular project

npm i ng-gallery @angular/cdk

and this is my package.json

{
"name": "client",
 "version": "0.0.0",
 "scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
 },
 "private": true,
"dependencies": {
"@angular/animations": "^16.1.0",
"@angular/common": "^16.1.0",
"@angular/compiler": "^16.1.0",
"@angular/core": "^16.1.0",
"@angular/forms": "^16.1.0",
"@angular/platform-browser": "^16.1.0",
"@angular/platform-browser-dynamic": "^16.1.0",
"@angular/router": "^16.1.0",
"bootstrap": "^5.2.3",
"bootswatch": "^5.3.2",
"font-awesome": "^4.7.0",
"ngx-bootstrap": "^11.0.2",
"ngx-toastr": "17",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.13.0"
 },
"devDependencies": {

"@angular-devkit/build-angular": "^16.1.8",

"@angular/cli": "~16.1.8",

"@angular/compiler-cli": "^16.1.0",

"@types/jasmine": "~4.3.0",

"jasmine-core": "~4.6.0",

"karma": "~6.4.0",

"karma-chrome-launcher": "~3.2.0",

"karma-coverage": "~2.2.0",

"karma-jasmine": "~5.1.0",

"karma-jasmine-html-reporter": "~2.1.0",

"typescript": "~5.1.3"
}
}

and this is the error im getting when im trying to install them

npm ERR! code ERESOLVE

npm ERR! ERESOLVE unable to resolve dependency tree

npm ERR!

npm ERR! While resolving: client@0.0.0

npm ERR! Found: @angular/common@16.2.12

npm ERR! node_modules/@angular/common

npm ERR!  @angular/common@"^16.1.0" from the root project

npm ERR!  peer @angular/common@">=16.0.0" from ng-gallery@11.0.0

npm ERR!  node_modules/ng-gallery

npm ERR!    ng-gallery@"*" from the root project

npm ERR!

npm ERR! Could not resolve dependency:

npm ERR! peer @angular/common@"^17.0.0 || ^18.0.0" from @angular/cdk@17.0.4

npm ERR! node_modules/@angular/cdk

npm ERR!  @angular/cdk@"*" from the root project

npm ERR!  peer @angular/cdk@">=16.0.0" from ng-gallery@11.0.0

npm ERR!  node_modules/ng-gallery

npm ERR!    ng-gallery@"*" from the root project

npm ERR!

npm ERR! Fix the upstream dependency conflict, or retry

npm ERR! this command with --force or --legacy-peer-deps

npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

npm ERR!

npm ERR!

npm ERR! For a full report see:

npm ERR! C:\Users\user\AppData\Local\npm-cache\_logs\2024-01-05T14_36_30_765Z-eresolve-report.txt   
MurhafSousli commented 8 months ago

If you are using Angular 16, then use npm i ng-gallery @angular/cdk@16

If you want to install the newer beta version npm i ng-gallery@beta @angular/cdk@16