title: Could not resolve peer dependency between my Angular app and my custom Angular library
body: <p>I have created this Angular library that I now want to use in my other Angular apps, but I seem to have trouble with my peer dependencies. I have tried fiddling around in my App's package.json, but couldn't seem to remove any of my errors.</p>
  <p>What I have tried (in that order) :</p>
  <ul>
  <li>Removing node_modules</li>
  <li>ng update</li>
  <li>npm update</li>
  <li>npm audit --fix</li>
  <li>npm i</li>
  <li>Recreating a new test app all together</li>
  </ul>
  <p>Here are the errors :</p>
  <pre><code>npm ERR! code ERESOLVE
  npm ERR! ERESOLVE unable to resolve dependency tree
  npm ERR!
  npm ERR! While resolving: lib-test@0.0.0
  npm ERR! Found: @angular/common@13.0.3
  npm ERR! node_modules/@angular/common
  npm ERR!   @angular/common@&quot;~13.0.0&quot; from the root project
  npm ERR!   peer @angular/common@&quot;^13.0.0 || ^14.0.0-0&quot; from @angular/cdk@13.2.2
  npm ERR!   node_modules/@angular/cdk
  npm ERR!     @angular/cdk@&quot;^13.2.0&quot; from the root project
  npm ERR!     peer @angular/cdk@&quot;^13.0.0&quot; from @my-group/angular-lib@1.1.4
  npm ERR!     node_modules/@my-group/angular-lib
  npm ERR!       @my-group/angular-lib@&quot;*&quot; from the root project
  npm ERR!
  npm ERR! Could not resolve dependency:
  npm ERR! peer @angular/common@&quot;^13.1.0&quot; from @my-group/angular-lib@1.1.4
  npm ERR! node_modules/@my-group/angular-lib
  npm ERR!   @my-group/angular-lib@&quot;*&quot; 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.
  </code></pre>
  <p>package.json (App)</p>
  <pre><code>{
    &quot;name&quot;: &quot;lib-test&quot;,
    &quot;version&quot;: &quot;0.0.0&quot;,
    &quot;scripts&quot;: {
      &quot;ng&quot;: &quot;ng&quot;,
      &quot;start&quot;: &quot;ng serve&quot;,
      &quot;build&quot;: &quot;ng build&quot;,
      &quot;watch&quot;: &quot;ng build --watch --configuration development&quot;,
      &quot;test&quot;: &quot;ng test&quot;
    },
    &quot;private&quot;: true,
    &quot;dependencies&quot;: {
      &quot;@angular/animations&quot;: &quot;~13.0.0&quot;,
      &quot;@angular/cdk&quot;: &quot;^13.2.2&quot;,
      &quot;@angular/common&quot;: &quot;~13.0.0&quot;,
      &quot;@angular/compiler&quot;: &quot;~13.0.0&quot;,
      &quot;@angular/core&quot;: &quot;~13.0.0&quot;,
      &quot;@angular/forms&quot;: &quot;~13.0.0&quot;,
      &quot;@angular/material&quot;: &quot;^13.2.2&quot;,
      &quot;@angular/platform-browser&quot;: &quot;~13.0.0&quot;,
      &quot;@angular/platform-browser-dynamic&quot;: &quot;~13.0.0&quot;,
      &quot;@angular/router&quot;: &quot;~13.0.0&quot;,
      &quot;@cloud-republic/angular-lib&quot;: &quot;^1.1.4&quot;,
      &quot;rxjs&quot;: &quot;~7.4.0&quot;,
      &quot;tslib&quot;: &quot;^2.3.0&quot;,
      &quot;zone.js&quot;: &quot;~0.11.4&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;@angular-devkit/build-angular&quot;: &quot;~13.0.3&quot;,
      &quot;@angular/cli&quot;: &quot;~13.0.3&quot;,
      &quot;@angular/compiler-cli&quot;: &quot;~13.0.0&quot;,
      &quot;@types/jasmine&quot;: &quot;~3.10.0&quot;,
      &quot;@types/node&quot;: &quot;^12.11.1&quot;,
      &quot;jasmine-core&quot;: &quot;~3.10.0&quot;,
      &quot;karma&quot;: &quot;~6.3.0&quot;,
      &quot;karma-chrome-launcher&quot;: &quot;~3.1.0&quot;,
      &quot;karma-coverage&quot;: &quot;~2.0.3&quot;,
      &quot;karma-jasmine&quot;: &quot;~4.0.0&quot;,
      &quot;karma-jasmine-html-reporter&quot;: &quot;~1.7.0&quot;,
      &quot;typescript&quot;: &quot;~4.4.3&quot;
    }
  }
  </code></pre>
  <p>package.json (Library)</p>
  <pre><code>{
    &quot;name&quot;: &quot;@my-group/angular-lib&quot;,
    &quot;version&quot;: &quot;1.0.6&quot;,
    &quot;publishConfig&quot;: {
      &quot;@my-group:registry&quot;: &quot;https://gitlab.com/api/v4/projects/XXXXXX/packages/npm/&quot;
    },
    &quot;scripts&quot;: {
      &quot;build-lib&quot;: &quot;ng build lib-angular&quot;,
      &quot;semantic-release&quot;: &quot;semantic-release&quot;
    },
    &quot;peerDependencies&quot;: {
      &quot;@angular/cdk&quot;: &quot;^13.0.0&quot;,
      &quot;@angular/common&quot;: &quot;^13.1.0&quot;,
      &quot;@angular/core&quot;: &quot;^13.1.0&quot;,
      &quot;@angular/material&quot;: &quot;^13.2.0&quot;,
      &quot;ngx-bootstrap&quot;: &quot;^8.0.0&quot;,
      &quot;rxjs&quot;: &quot;~7.4.0&quot;
    },
    &quot;dependencies&quot;: {
      &quot;tslib&quot;: &quot;^2.3.0&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;@semantic-release/gitlab&quot;: &quot;^7.0.4&quot;,
      &quot;semantic-release&quot;: &quot;^19.0.2&quot;
    }
  }
  </code></pre>
  <p>Thanks in advance</p>