如果我已安装ng build --prod
库并使用了ng-block-ui
,则在项目角运行in app.module.ts
时出现错误。
错误是:
ERROR in ./node_modules/rxjs/observable/BoundNodeCallbackObservable.js
Module build failed: TypeError: Cannot read property 'type' of undefined
at Object.getEffectiveTypeAnnotationNode (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:9341:18)
at assignContextualParameterTypes (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:41652:25)
at checkFunctionExpressionOrObjectLiteralMethod (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:41948:29)
at checkExpressionWorker (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:42959:28)
at checkExpression (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:42898:42)
at checkExpressionCached (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:42779:38)
at checkReturnStatement (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:45418:54)
at checkSourceElement (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:46763:28)
at Object.forEach (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:1506:30)
at checkBlock (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:44563:16)
at checkSourceElement (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:46742:28)
at checkFunctionExpressionOrObjectLiteralMethodDeferred (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:41990:21)
at checkDeferredNodes (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:46828:25)
at checkSourceFileWorker (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:46863:17)
at checkSourceFile (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:46842:13)
at Object.forEach (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:1506:30)
@ ./node_modules/rxjs/observable/bindNodeCallback.js 2:36-76
@ ./node_modules/rxjs/add/observable/bindNodeCallback.js
@ ./node_modules/rxjs/Rx.js
@ ./node_modules/ng-block-ui/lib/services/block-ui-instance.service.js
@ ./node_modules/ng-block-ui/lib/components/block-ui/block-ui.component.ngfactory.js
@ ./src/app/app.module.ngfactory.js
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in ./node_modules/rxjs/observable/BoundCallbackObservable.js
Module build failed: TypeError: Cannot read property 'type' of undefined
at Object.getEffectiveTypeAnnotationNode (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:9341:18)
at assignContextualParameterTypes (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:41652:25)
at checkFunctionExpressionOrObjectLiteralMethod (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:41948:29)
at checkExpressionWorker (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:42959:28)
at checkExpression (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:42898:42)
at checkExpressionCached (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:42779:38)
at checkReturnStatement (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:45418:54)
at checkSourceElement (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:46763:28)
at Object.forEach (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:1506:30)
at checkBlock (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:44563:16)
at checkSourceElement (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:46742:28)
at checkFunctionExpressionOrObjectLiteralMethodDeferred (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:41990:21)
at checkDeferredNodes (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:46828:25)
at checkSourceFileWorker (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:46863:17)
at checkSourceFile (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:46842:13)
at Object.forEach (C:\Users\Mario\Desktop\HE CONNECT\HeConnect\node_modules\typescript\lib\typescript.js:1506:30)
@ ./node_modules/rxjs/observable/bindCallback.js 2:32-68
@ ./node_modules/rxjs/add/observable/bindCallback.js
@ ./node_modules/rxjs/Rx.js
@ ./node_modules/ng-block-ui/lib/services/block-ui-instance.service.js
@ ./node_modules/ng-block-ui/lib/components/block-ui/block-ui.component.ngfactory.js
@ ./src/app/app.module.ngfactory.js
@ ./src/main.ts
@ multi ./src/main.ts
我的package.json:
{
"name": "sociallike",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"extract": "ngx-translate-extract --marker __ --input ./src --output ./src/assets/i18n/en.json ./src/assets/i18n/it.json --clean --sort --format namespaced-json "
},
"private": true,
"dependencies": {
"3": "^2.1.0",
"3.0.0": "^3.0.0",
"@angular/animations": "^5.0.2",
"@angular/cdk": "^5.0.0-rc0",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/forms": "^5.0.0",
"@angular/http": "^5.0.0",
"@angular/material": "^5.0.0-rc0",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/router": "^5.0.0",
"@ngx-translate/core": "^8.0.0",
"@ngx-translate/http-loader": "^2.0.0",
"@types/moment": "^2.13.0",
"angular2-useful-swiper": "^5.0.1",
"core-js": "^2.4.1",
"hammerjs": "^2.0.8",
"intl": "^1.2.5",
"masonry-layout": "^4.2.0",
"md2": "0.0.29",
"messageformat": "^1.1.0",
"moment": "^2.19.2",
"ng-block-ui": "^2.1.1",
"ng2-truncate": "^1.3.11",
"ngx-clipboard": "^8.1.3",
"ngx-infinite-scroll": "^0.8.4",
"ngx-translate-messageformat-compiler": "^2.1.0",
"rxjs": "^5.5.2",
"swiper": "^3.4.2",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "1.5.2",
"@angular/compiler-cli": "^5.0.0",
"@angular/language-service": "^5.0.0",
"@biesbjerg/ngx-translate-extract": "^2.3.4",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "~3.2.0",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.7.0",
"typescript": "~2.4.2"
}
}
我可以解决吗?感谢帮助