我有一个用角4写的应用程序。
package.json:
{
"name": "frontend",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"build-bundle-report": "ng build --prod --stats-json && webpack-bundle-analyzer dist/stats.json",
"bundle-report": "webpack-bundle-analyzer dist/stats.json"
},
"private": true,
"dependencies": {
"@angular/animations": "^4.1.3",
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"@ngui/datetime-picker": "^0.16.2",
"angular2-modal": "^3.0.1",
"angular2-text-mask": "^8.0.1",
"core-js": "^2.4.1",
"flexboxgrid": "^6.3.1",
"moment": "^2.18.1",
"ng-select": "^1.0.0-beta.5",
"ng2-pagination": "^2.0.2",
"ng2-toastr": "^4.1.0",
"rxjs": "^5.1.0",
"zone.js": "^0.8.4"
},
"devDependencies": {
"@angular/cli": "^1.2.7",
"@angular/compiler-cli": "^4.0.0",
"@types/jasmine": "2.5.38",
"@types/node": "~6.0.60",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"@ngui/datetime-picker": "^0.16.2",
"angular2-modal": "^3.0.1",
"angular2-text-mask": "^8.0.1",
"core-js": "^2.4.1",
"flexboxgrid": "^6.3.1",
"moment": "^2.18.1",
"ng-select": "^1.0.0-beta.5",
"ng2-pagination": "^2.0.2",
"ng2-toastr": "^4.1.0",
"rxjs": "^5.1.0",
"zone.js": "^0.8.4"
}
}如何在不损坏代码的情况下将其更新为角5?上一次我试图更新它时,有些代码停止工作。我会非常感谢每一个愿意帮忙的人。
发布于 2018-02-06 03:36:26
要升级你的应用程序,我推荐这个朗读
简而言之,您应该运行:
npm install @angular/{animations,common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router}@5.0.0 您可以使用任何版本的5.x替换@5.0.0。
您需要的另一件事是将类型记录更新为2.4.2,将RxJS更新为5.5.2
npm install typescript@2.4.2 rxjs@5.5.2https://stackoverflow.com/questions/48634992
复制相似问题