Q:

ERROR in ** is not an NgModule

I have this NgModule:
@NgModule({
    imports: [
        CommonModule
    ],
    exports: [
        SP21LoadingBar
    ],
    declarations: [SP21LoadingBar]
})
export class SP21LoadingBarModule { }

The Cli ist telling me 
ERROR in SP21LoadingBarModule is not an NgModule

Please notice: If i take the code and put it into my project it works fine. But as soon as I take the module (and component) out of my project and put it into a npm package, i get that error.
Angular is used in 2.3.1,
Angular CLI 1.0.0-beta.24,
Typescript 2.0.10

A:

The FINAL solution:
You must compile your library using the Ahead-Of-Time compiler (ngc). It will add some metadata that allos the project that includes the library to read it.
Please, have a look on the follow links:
https://angular.io/docs/ts/latest/cookbook/aot-compiler.html
https://medium.com/@cyrilletuzi/how-to-build-and-publish-an-angular-module-7ad19c0b4464#.9y88ipdk7

