【发布时间】:2018-04-26 21:13:50
【问题描述】:
我正在使用角度通用 1.0.0-alpha.universal.3
我使用 Angular 通用 cli 创建了新应用。
ung new test-app --universal
package.json
{ “名称”:“测试应用程序”, “版本”:“0.0.0”, “许可证”:“麻省理工学院”, “角-cli”:{}, “脚本”:{ “开始”:“服务”, "lint": "tslint \"src/**/*.ts\"", “测试”:“ung测试”, "pree2e": "webdriver-manager 更新 --standalone false --gecko false", “e2e”:“量角器” }, “私人”:真的, “依赖”:{ "@angular/common": "2.2.3", "@angular/compiler": "2.2.3", "@angular/core": "2.2.3", "@angular/forms": "2.2.3", "@angular/http": "2.2.3", "@angular/platform-browser": "^2.2.3", "@angular/platform-browser-dynamic": "2.2.3", "@angular/platform-server": "^2.2.3", "@angular/路由器": "3.2.3", "@ngx-universal/state-transfer": "^4.0.1", “angular2-express-engine”:“2.1.0-rc.1”, "angular2-flash-messages": "^1.0.8", “angular2-jwt”:“^0.2.3”, “angular2-平台节点”:“2.1.0-rc.1”, “angular2-universal”:“2.1.0-rc.1”, “angular2-universal-polyfills”:“2.1.0-rc.1”, "bcryptjs": "^2.4.3", “引导程序”:“^3.3.7”, “压缩”:“1.6.2”, "core-js": "^2.4.1", "cors": "^2.8.4", "快递": "^4.14.0", "字体真棒": "^4.7.0", "jquery": "^3.2.1", "jsonwebtoken": "^8.1.0", “猫鼬”:“^4.13.1”, "护照": "^0.4.0", “护照-jwt”:“^3.0.0”, "本地护照": "^1.0.0", “rxjs”:“5.0.0-beta.12”, "ts-helpers": "^1.1.1", “zone.js”:“^0.6.23” }, “开发依赖”:{ "@angular/compiler-cli": "2.2.3", "@types/jasmine": "2.5.38", "@types/node": "^6.0.42", "@types/body-parser": "0.0.29", "@types/compression": "0.0.29", "@types/cookie-parser": "^1.3.29", "@types/express": "^4.0.29", "@types/express-serve-static-core": "^4.0.29", "@types/mime": "0.0.28", "@types/serve-static": "^1.7.27", “通用-cli”:“1.0.0-alpha.universal.3”, "codelyzer": "~2.0.0-beta.1", “茉莉花核”:“2.5.2”, “茉莉花规格报告者”:“2.5.0”, “业力”:“1.2.0”, "karma-chrome-launcher": "^2.0.0", "业力-cli": "^1.0.1", “业力茉莉花”:“^1.0.2”, “业力重映射伊斯坦布尔”:“^0.2.1”, “量角器”:“~4.0.13”, “ts节点”:“1.2.1”, "tslint": "^4.0.2", “打字稿”:“~2.0.3” } }我想在我的 app.browser.module.ts 文件中添加以下 browserModule
BrowserModule.withServerTransition({ appId: 'test-app' })
添加此脚本后出现以下错误。
未捕获的错误:模块构建失败:错误:E:/projects/Angular2/test-app/src/app/app.browser.module.ts (32,19):“typeof BrowserModule”类型上不存在属性“withServerTransition” .) 在 _checkDiagnostics (E:\projects\Angular2\test-app\node_modules\@ngtools\webpack\src\loader.js:115:15) 在 E:\projects\Angular2\test-app\node_modules\@ngtools\webpack\src\loader.js:140:17 在 在 _checkDiagnostics (E:\projects\Angular2\test-app\node_modules\@ngtools\webpack\src\loader.js:115:15) 在 E:\projects\Angular2\test-app\node_modules\@ngtools\webpack\src\loader.js:140:17 在 在 Object.433 (http://localhost:4200/client.bundle.js:83:7) 在 __webpack_require__ (http://localhost:4200/inline.bundle.js:53:30) 在 Object.334 (http://localhost:4200/client.bundle.js:29:82) 在 __webpack_require__ (http://localhost:4200/inline.bundle.js:53:30) 在 Object.624 (http://localhost:4200/client.bundle.js:171:18) 在 __webpack_require__ (http://localhost:4200/inline.bundle.js:53:30) 在 webpackJsonpCallback (http://localhost:4200/inline.bundle.js:24:23) 在 http://localhost:4200/client.bundle.js:1:1【问题讨论】:
-
您应该在问题中添加更多错误日志。它可以更好地帮助你。 How to Ask
标签: angular angular-universal angular2-cli