title: Angular 8: "Please add a @NgModule annotation" when including a library into another library
body: <p>I want to use one of my shared libraries in another shared library, but I am getting</p>
  
  <pre><code>ERROR: Unexpected value 'LibraryModule in ...' imported by the module 'TestlibModule in ...'. Please add a @NgModule annotation.
  </code></pre>
  
  <p>The libraries are in separate angular apps (test and test2). 
  Each app contains one library (generated through ng generate library) which I build by running ng build library_name</p>
  
  <p>a library in the test app (called testlib) includes the library from test2 (called library) through npm</p>
  
  <p>package.json:</p>
  
  <pre><code>...
  "dependencies": {
    "@angular/animations": "~8.2.14",
    ...
    "library": "file:../../test2/test2/dist/library"
  },
  </code></pre>
  
  <p>testlib.module.ts</p>
  
  <pre><code>import { NgModule } from '@angular/core';
  import { TestlibComponent } from './testlib.component';
  import { LibraryModule } from 'library';
  
  @NgModule({
    declarations: [TestlibComponent],
    imports: [
      LibraryModule
    ],
    exports: [TestlibComponent]
  })
  export class TestlibModule { }
  </code></pre>
  
  <p>tsconfig.lib.json in the included library</p>
  
  <pre><code>{
    "extends": "../../tsconfig.json",
    "compilerOptions": {
      "outDir": "../../out-tsc/lib",
      "target": "es2015",
      "declaration": true,
      "inlineSources": true,
      "types": [],
      "lib": [
        "dom",
        "es2018"
      ]
    },
    "angularCompilerOptions": {
      "annotateForClosureCompiler": true,
      "skipTemplateCodegen": true,
      "strictMetadataEmit": true,
      "fullTemplateTypeCheck": true,
      "strictInjectionParameters": true,
      "enableResourceInlining": true
    },
    "exclude": [
      "src/test.ts",
      "**/*.spec.ts"
    ]
  }
  </code></pre>
  
  <p>LibraryModule can be included without any problems into an application, but it crashes with the mentioned error when included into a library. I cannot find out what I am doing wrong. Can anyone point me in the right direction?</p>