shipshapecode / angular-shepherd

An Angular wrapper for the site tour library Shepherd
MIT License
216 stars 44 forks source link

Incorrect peer dependencies #1955

Closed KeithGillette closed 2 months ago

KeithGillette commented 1 year ago

An npm install on this project produces:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @angular/animations@16.1.5
npm ERR! Found: @angular/core@16.1.4
npm ERR! node_modules/@angular/core
npm ERR!   @angular/core@"^16.1.4" from the root project
npm ERR!   peer @angular/core@"16.1.4" from @angular/common@16.1.4
npm ERR!   node_modules/@angular/common
npm ERR!     @angular/common@"^16.1.4" from the root project
npm ERR!     peer @angular/common@"16.1.4" from @angular/platform-browser@16.1.4
npm ERR!     node_modules/@angular/platform-browser
npm ERR!       @angular/platform-browser@"^16.1.4" from the root project
npm ERR!       2 more (@angular/platform-browser-dynamic, @angular/router)
npm ERR!     2 more (@angular/platform-browser-dynamic, @angular/router)
npm ERR!   4 more (@angular/compiler, @angular/platform-browser, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/core@"16.1.5" from @angular/animations@16.1.5
npm ERR! node_modules/@angular/animations
npm ERR!   @angular/animations@"^16.1.5" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @angular/core@16.1.5
npm ERR! node_modules/@angular/core
npm ERR!   peer @angular/core@"16.1.5" from @angular/animations@16.1.5
npm ERR!   node_modules/@angular/animations
npm ERR!     @angular/animations@"^16.1.5" 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.
RobbieTheWagner commented 1 year ago

@KeithGillette I don't understand the issue here. It sounds like maybe you have some incorrect versions in your app?

KeithGillette commented 1 year ago

Hi, @RobbieTheWagner — No, I'm talking about this project. I can use the published library in my own project without error. I cloned this repository and performed npm install and got those installation errors. I should mention I'm using node 18.16.1.

RobbieTheWagner commented 1 year ago

Ah, okay. Sorry, I misunderstood. I noticed the same thing, but not sure how to fix it.

KeithGillette commented 1 year ago

I don't know anything about building Angular libraries and usually pin all dependencies at a known compatible version but was able to resolve the issue by replacing the carets with tildes to narrow the version ranges:

{
  "name": "angular-shepherd",
  "version": "16.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "build_lib": "ng build shepherd",
    "npm_pack": "cd dist/angular-shepherd && npm pack",
    "package": "npm run build_lib && npm run npm_pack"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~16.1.6",
    "@angular/common": "~16.1.6",
    "@angular/compiler": "~16.1.6",
    "@angular/core": "~16.1.6",
    "@angular/platform-browser": "~16.1.6",
    "@angular/platform-browser-dynamic": "~16.1.6",
    "core-js": "~3.31.1",
    "rxjs": "~7.8.1",
    "shepherd.js": "~11.0.1",
    "tslib": "~2.6.0",
    "zone.js": "~0.13.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~16.1.5",
    "@angular-eslint/builder": "16.1.0",
    "@angular-eslint/eslint-plugin": "16.1.0",
    "@angular-eslint/eslint-plugin-template": "16.1.0",
    "@angular-eslint/schematics": "16.1.0",
    "@angular-eslint/template-parser": "16.1.0",
    "@angular/cli": "~16.1.5",
    "@angular/compiler-cli": "~16.1.6",
    "@angular/language-service": "~16.1.6",
    "@angular/router": "~16.1.6",
    "@types/jasmine": "~4.3.5",
    "@types/jasminewd2": "~2.0.10",
    "@types/node": "~20.4.2",
    "@typescript-eslint/eslint-plugin": "6.0.0",
    "@typescript-eslint/parser": "6.0.0",
    "eslint": "~8.44.0",
    "jasmine-core": "~5.0.1",
    "jasmine-spec-reporter": "~7.0.0",
    "karma": "~6.4.2",
    "karma-chrome-launcher": "~3.2.0",
    "karma-coverage-istanbul-reporter": "~3.0.3",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.1.0",
    "ng-packagr": "~16.1.0",
    "protractor": "~7.0.0",
    "ts-node": "~10.9.1",
    "typescript": "~5.1.6"
  },
  "volta": {
    "node": "18.12.0"
  }
}
RobbieTheWagner commented 2 months ago

I'm hoping this magically resolved itself. Closing for now.