Reputation: 2765
This is my tsconfig-build.json used for taking the build
{
"compilerOptions": {
"target": "es5",
"module": "es2015",
"sourceMap": true,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"declaration": true,
"outDir": "../dist"
},
"files": ["./index.ts"],
"angularCompilerOptions": {
"genDir": "compiled",
"strictMetadataEmit": true,
"skipTemplateCodegen": true
},
"exclude": [
"node_modules",
"dist",
"gh-pages",
"**/*.ngfactory.ts",
"**/*.shim.ts",
"**/*.spec.ts"
]
}
this is the script in my package.json file
"scripts": {
"prebuild": "rimraf ./dist ./compiled",
"build": "ngc -p ./src/tsconfig-build.json"
},
While running the script npm run build
, Im getting missing error listed below.
../node_modules/@angular/core/src/di/reflective_provider.d.ts(87,123): error TS2304: Cannot find name 'Map'.
../node_modules/@angular/core/src/di/reflective_provider.d.ts(87,165): error TS2304: Cannot find name 'Map'.
../node_modules/rxjs/Observable.d.ts(58,60): error TS2693: 'Promise' only refers to a type, but is being used as a value here.
../node_modules/rxjs/Observable.d.ts(73,59): error TS2693: 'Promise' only refers to a type, but is being used as a value here.
../node_modules/@angular/core/src/change_detection/differs/iterable_differs.d.ts(14,48): error TS2304: Cannot find name 'Iterable'.
../node_modules/@angular/core/src/change_detection/differs/keyvalue_differs.d.ts(22,18): error TS2304: Cannot find name 'Map'.
../node_modules/@angular/core/src/change_detection/differs/default_iterable_differ.d.ts(12,32): error TS2304: Cannot find name 'Iterable'.../node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(24,16): error TS2304: Cannot find name 'Map'.
../node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(32,16): error TS2304: Cannot find name 'Map'.
../node_modules/@angular/common/src/directives/ng_class.d.ts(48,34): error TS2304: Cannot find name 'Set'.
../node_modules/ionic-angular/util/module-loader.d.ts(13,14): error TS2304: Cannot find name 'Map'.
../node_modules/ionic-angular/util/module-loader.d.ts(14,18): error TS2304: Cannot find name 'Map'.
../node_modules/ionic-angular/util/base-input.d.ts(2,38): error TS2307: Cannot find module '@angular/forms'.
../node_modules/ionic-angular/util/base-input.d.ts(3,27): error TS2307: Cannot find module '@angular/forms'.
../node_modules/ionic-angular/components/datetime/datetime.d.ts(2,38): error TS2307: Cannot find module '@angular/forms'.
../node_modules/ionic-angular/components/input/input.d.ts(2,27): error TS2307: Cannot find module '@angular/forms'.
../node_modules/ionic-angular/components/range/range.d.ts(2,38): error TS2307: Cannot find module '@angular/forms'.
../node_modules/ionic-angular/components/searchbar/searchbar.d.ts(2,27): error TS2307: Cannot find module '@angular/forms'.
../node_modules/ionic-angular/components/segment/segment.d.ts(2,27): error TS2307: Cannot find module '@angular/forms'.
../node_modules/ionic-angular/gestures/gesture-config.d.ts(1,37): error TS2307: Cannot find module '@angular/platform-browser'.
Its a simple angular directive for ionic app,What might be the reason for above missing statements ?
Upvotes: 1
Views: 306
Reputation: 222582
Change your tsconfig.json
as
"compilerOptions": {
"target": "es5",
"lib": ["es5", "es6", "dom"], <--- this
...
}
Upvotes: 2