gpt4 book ai didi

angular - 如何在 Angular CLI 中更新 angular 2

转载 作者:太空狗 更新时间:2023-10-29 17:26:08 26 4
gpt4 key购买 nike

如何更新 Angular 2 版本?我使用 Angular CLI 1.0.0-beta.20-4 并尝试了 npm update --save 但它没有做任何事情。

下面是我目前的 package.json 文件。感谢对此的任何帮助。

{
"name": "todo1",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"start": "ng serve",
"lint": "tslint \"src/**/*.ts\"",
"test": "ng test",
"pree2e": "webdriver-manager update",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"@angular/common": "2.2.1",
"@angular/compiler": "2.2.1",
"@angular/core": "2.2.1",
"@angular/forms": "2.2.1",
"@angular/http": "2.2.1",
"@angular/material": "^2.0.0-alpha.11-3",
"@angular/platform-browser": "2.2.1",
"@angular/platform-browser-dynamic": "2.2.1",
"@angular/router": "3.0.0",
"@types/hammerjs": "^2.0.33",
"@types/lodash": "^4.14.43",
"angular2-jwt": "^0.1.25",
"angular2-uuid": "^1.1.0",
"core-js": "^2.4.1",
"hammerjs": "^2.0.8",
"lodash": "^4.17.2",
"material-design-icons": "^3.0.1",
"rxjs": "5.0.0-beta.12",
"ts-helpers": "^1.1.1",
"zone.js": "^0.6.23"
},
"devDependencies": {
"@types/hammerjs": "^2.0.33",
"@types/jasmine": "^2.2.30",
"angular-cli": "^1.0.0-beta.20-4",
"codelyzer": "~0.0.26",
"jasmine-core": "2.4.1",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "4.0.5",
"ts-node": "1.2.1",
"tslint": "3.13.0",
"typescript": "2.0.2"
}
}

最佳答案

您可以更改@angular 版本以使用插入符号范围,以便 NPM 将安装最新的包直到下一个主要版本。

  "dependencies": {
"@angular/common": "^2.2.1",
"@angular/compiler": "^2.2.1",
"@angular/core": "^2.2.1",
"@angular/forms": "^2.2.1",
"@angular/http": "^2.2.1",

也值得更新到最新的 angular-cli 版本。参见 here获取说明。

关于angular - 如何在 Angular CLI 中更新 angular 2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41221445/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com