0

I have created a Angular npm package (with ng-packgr) that uses the npm package jwt-decode, when I updated to Angular 14 in the project of the npm package and then used it in a different project I get "Module not found: Error: Can't resolve 'jwt-decode' in xxx".

Package.json:

   "peerDependencies": {
    "@angular/animations": "~14.2.4",
    "@angular/common": "~14.2.4",
    "@angular/compiler": "~14.2.4",
    "@angular/core": "~14.2.4",
    "@angular/forms": "~14.2.4",
    "@angular/platform-browser": "~14.2.4",
    "@angular/platform-browser-dynamic": "~14.2.4",
    "@angular/router": "~14.2.4",
    "core-js": "^3.25.5",
    "jwt-decode": "^3.1.2",
    "node-sass": "^7.0.3",
    "rxjs": "~7.5.7",
    "tslib": "^2.4.0",
    "zone.js": "~0.11.8"
  }

If I in the project that uses my npm package separatly install jwt-decode it works..But I would like that my npm package either comes with jwt-decode or at least install it by default. Where do I configure this so that the user of my npm package don't need to install jwt-decode them self?

0 Answers0