title: Angular - Add local external Module to App
body: <p>I have a project <strong>my-components</strong> and a project <strong>my-showcase</strong>. <strong>my-components</strong> is an Angular library and <strong>my-showcase</strong> is an Angular app. At time, when I change or add an component in library, I make a commit to private git and publish to private npm. Then I can use it in other apps like <strong>my-showcase</strong>. Before commit and publish I would test it. Until now, I create and develop a new component in my-showcase. After finish, I put it to <strong>my-components</strong>. </p>
  
  <p>At time I import my angular component library over npm:</p>
  
  <pre><code>import {TimePickerModule} from '@company/components';
  </code></pre>
  
  <p>For testing and development I change this to local path:</p>
  
  <pre><code>import {TimePickerModule} from '../../../../company-components/projects/components/src';
  </code></pre>
  
  <p>Unfortunately, I get the following error message:</p>
  
  <pre><code>WARNING in ../company-components/node_modules/@angular/core/fesm5/core.js 15153:15-36
  Critical dependency: the request of a dependency is an expression
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>core.js:12584 ERROR Error: Uncaught (in promise): Error: StaticInjectorError(AppModule)[DcStickyBitsDirective -&gt; ElementRef]:
    StaticInjectorError(Platform: core)[DcStickyBitsDirective -&gt; ElementRef]:
      NullInjectorError: No provider for ElementRef!
  </code></pre>
  
  <p>Apparently the component from the library in app <strong>my-showcase</strong> use the wrong node_module folder from <strong>my-components</strong> (specially @angular/core), not the node_module folder from <strong>my-showcase</strong>.</p>
  
  <p>Does anyone have a solution for me or have I a wrong understanding when dealing with Angular Library and NPM? If it was too incomprehensible, please let me know.</p>