2
votes

since I upgraded to latests dependencies (removed old node_modules and re-ran npm install;npm build) my angular library no more builds. I see errors like :

Error at /home/kmoyse/akgsworkspace/kwp-angular2/node_modules/@angular/core/src/facade/lang.d.ts:12:17: 'Map' only refers to a type, but is being used as a value here. Error at /home/kmoyse/akgsworkspace/kwp-angular2/node_modules/@angular/core/src/facade/lang.d.ts:13:17: 'Set' only refers to a type, but is being used as a value here. Error at /home/kmoyse/akgsworkspace/kwp-angular2/node_modules/rxjs/Observable.d.ts:68:60: 'Promise' only refers to a type, but is being used as a value here. Error at /home/kmoyse/akgsworkspace/kwp-angular2/node_modules/rxjs/operator/toPromise.d.ts:3:79: 'Promise' only refers to a type, but is being used as a value here. Error at /home/kmoyse/akgsworkspace/kwp-angular2/src/configuration/configuration.service.ts:28:16: 'Promise' only refers to a type, but is being used as a value here. Error at /home/kmoyse/akgsworkspace/kwp-angular2/src/compiled/node_modules/@angular/common/common.ngfactory.ts:11:44: Property 'ɵNgModuleInjector' does not exist on type 'typeof "/home/kmoyse/akgsworkspace/kwp-angular2/node_modules/@angular/core/index"'. Error at /home/kmoyse/akgsworkspace/kwp-angular2/src/compiled/node_modules/@angular/common/common.ngfactory.ts:13:30: Namespace '"/home/kmoyse/akgsworkspace/kwp-angular2/node_modules/@angular/common/index"' has no exported member 'NgLocaleLocalization'.

My library can be cloned from : git clone https://github.com/akigrafsoft/kwp-angular2

And simply run : npm install npm run build

to reproduce the issue.

Please notice that this used to work before...

1
how did you updated the dependencies - Aravind
Hello, I removed the node_modules directory and called npm install again. I'm using node 6.5.0 and npm 4.4.4. - Akigraf

1 Answers

0
votes

Helo, I fixed issues by removing compiled directory from src and updating tsconfig.json :

    "compilerOptions": {
        "target": "es5",
        "module": "es2015",
        "skipLibCheck": true,
        "typeRoots": [
            "./node_modules/@types"
        ],
        "lib": [
            "dom",
            "es2015"
        ]
    },

and :

"angularCompilerOptions": {
    "genDir": "../compiled"
}