建立角度通用应用程式时发生错误

时间:2019-12-07 08:13:21

标签: angular angular-universal

我的应用可以正常投放,但是在进行npm run build:ssr && npm run serve:ssr 时遇到此错误 这是angular-errors.log的内容:

  

[错误] TypeError:无法分配为只读对象“#”的属性“ _showWarnings”

at TapSubscriber._visitJsonRecursive.pipe.operators_1.tap.x [as _tapNext] (app-directory\node_modules\@angular-devkit\core\src\json\schema\visitor.js:56:210)
at TapSubscriber._next (app-directory\node_modules\@angular-devkit\core\node_modules\rxjs\internal\operators\tap.js:59:27)
at TapSubscriber.Subscriber.next (app-directory\node_modules\@angular-devkit\core\node_modules\rxjs\internal\Subscriber.js:66:18)
at MergeMapSubscriber.notifyNext (app-directory\node_modules\@angular-devkit\core\node_modules\rxjs\internal\operators\mergeMap.js:92:26)
at InnerSubscriber._next (app-directory\node_modules\@angular-devkit\core\node_modules\rxjs\internal\InnerSubscriber.js:28:21)
at InnerSubscriber.Subscriber.next (app-directory\node_modules\@angular-devkit\core\node_modules\rxjs\internal\Subscriber.js:66:18)
at app-directory\node_modules\@angular-devkit\core\node_modules\rxjs\internal\util\subscribeTo.js:17:28
at Object.subscribeToResult (app-directory\node_modules\@angular-devkit\core\node_modules\rxjs\internal\util\subscribeToResult.js:10:45)
at MergeMapSubscriber._innerSub (app-directory\node_modules\@angular-devkit\core\node_modules\rxjs\internal\operators\mergeMap.js:82:29)
at MergeMapSubscriber._tryNext (app-directory\node_modules\@angular-devkit\core\node_modules\rxjs\internal\operators\mergeMap.js:76:14)
at MergeMapSubscriber._next (app-directory\node_modules\@angular-devkit\core\node_modules\rxjs\internal\operators\mergeMap.js:59:18)
at MergeMapSubscriber.Subscriber.next (app-directory\node_modules\@angular-devkit\core\node_modules\rxjs\internal\Subscriber.js:66:18)
at Observable._subscribe (app-directory\node_modules\@angular-devkit\core\node_modules\rxjs\internal\observable\scalar.js:6:20)
at Observable._trySubscribe (app-directory\node_modules\@angular-devkit\core\node_modules\rxjs\internal\Observable.js:44:25)
at Observable.subscribe (app-directory\node_modules\@angular-devkit\core\node_modules\rxjs\internal\Observable.js:30:22)
at MergeMapOperator.call (app-directory\node_modules\@angular-devkit\core\node_modules\rxjs\internal\operators\mergeMap.js:39:23)

这是我在某处阅读的package-lock.json依赖关系,具体来说,他们说可能是a mismatch between angular/cli and @angular-devkit/build-angular version.,但在我看来,这很好:

> "dependencies": {
>     "@agm/core": "^1.1.0",
>     "@angular-persian/material-date-picker": "^1.8.1",
>     "@angular/animations": "^8.2.0",
>     "@angular/cdk": "~8.2.3",
>     "@angular/common": "^8.2.0",
>     "@angular/compiler": "^8.2.0",
>     "@angular/core": "^8.2.0",
>     "@angular/flex-layout": "^8.0.0-beta.27",
>     "@angular/forms": "^8.2.0",
>     "@angular/http": "^7.2.15",
>     "@angular/material": "^8.2.3",
>     "@angular/platform-browser": "^8.2.0",
>     "@angular/platform-browser-dynamic": "^8.2.0",
>     "@angular/platform-server": "^8.2.0",
>     "@angular/router": "^8.2.0",
>     "@aspnet/signalr": "^1.1.4",
>     "@ks89/angular-modal-gallery": "^7.2.5",
>     "@ng-select/ng-select": "3.6.1",
>     "@ngu/carousel": "^1.5.5",
>     "@nguniversal/express-engine": "^8.1.1",
>     "@nguniversal/module-map-ngfactory-loader": "8.1.1",
>     "@ngx-translate/core": "^11.0.1",
>     "@ngx-translate/http-loader": "^4.0.0",
>     "@nicky-lenaers/ngx-scroll-to": "^3.0.1",
>     "@nrwl/angular": "8.7.0",
>     "@nsalaun/ng-logger": "^7.0.0",
>     "@types/core-js": "^2.5.0",
>     "@types/html-minifier": "^3.5.3",
>     "@types/leaflet": "^1.5.5",
>     "angular-notifier": "^6.0.1",
>     "chart.js": "^2.9.3",
>     "chartjs-plugin-labels": "^1.1.0",
>     "core-js": "^2.4.1",
>     "devextreme": "19.2.4",
>     "devextreme-angular": "19.2.4",
>     "devextreme-intl": "^19.1.7",
>     "express": "^4.15.2",
>     "fate-editor": "^1.10.1",
>     "font-awesome": "^4.7.0",
>     "hammerjs": "^2.0.8",
>     "hashmap": "^2.4.0",
>     "install": "^0.13.0",
>     "jalali-moment": "^3.3.3",
>     "jquery": "^3.4.1",
>     "leaflet": "^1.6.0",
>     "moment-jalaali": "^0.9.1",
>     "mousetrap": "^1.6.3",
>     "ng-inline-svg": "^9.1.0",
>     "ng-recaptcha": "^5.0.0",
>     "ng-snotify": "^4.3.1",
>     "ng2-charts": "^2.3.0",
>     "ngx-drag-scroll": "^8.0.0-beta.2",
>     "ngx-owl-carousel-o": "^2.0.1",
>     "ngx-perfect-scrollbar": "^8.0.0",
>     "ngx-quill": "^7.3.11",
>     "ngx-spinner": "^8.0.3",
>     "node-sass": "^4.13.0",
>     "npm": "^6.13.1",
>     "protractor": "^5.4.2",
>     "rxjs": "^6.4.0",
>     "rxjs-compat": "^6.5.3",
>     "upcast": "^4.0.0",
>     "webpack-bundle-analyzer": "^3.6.0",
>     "zone.js": "^0.9.1"   },

1 个答案:

答案 0 :(得分:0)

嗯,事实证明,我们从一开始就有同样的问题。我不知道如何无法看到版本号不同。

所以……如我所说的here

"@angular-devkit/build-angular":"0.803.19"@angular-devkit/build-angular" :0.803.5

就这样解决了这个问题。