我刚刚在新安装的机器上安装了新的angular-cliץ运行时ng --version
我得到了:
date it to a more recent version.
angular-cli: 1.0.0-beta.10
node: 6.5.0
os: win32 x64
这似乎是最新更新(根据https://www.npmjs.com/package/angular-cli)
当我使用ng new MyProject
创建新项目时,我发现它使用了rc4
- 而我正在阅读已经支持rc6
并且人们成功使用它的地方(但没有如何升级的技术细节。
我的package.json
个依赖关系如下:
"dependencies": {
"@angular/common": "2.0.0-rc.4",
"@angular/compiler": "2.0.0-rc.4",
"@angular/core": "2.0.0-rc.4",
"@angular/forms": "0.2.0",
"@angular/http": "2.0.0-rc.4",
"@angular/platform-browser": "2.0.0-rc.4",
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
"@angular/router": "3.0.0-beta.2",
"es6-shim": "0.35.1",
"reflect-metadata": "0.1.3",
"rxjs": "5.0.0-beta.6",
"systemjs": "0.19.26",
"zone.js": "0.6.12"
}
如何将我的项目(新项目和现有项目)升级到rc6
并仍然可以使用angular-cli?
答案 0 :(得分:0)
<强>更新强> 关于Angular-Cli repo @ GitHub的Upgrading from angular-cli@1.0.0-beta.10 to the angular-cli@webpack指南。
将package.json
依赖关系更改为:
"dependencies": {
"@angular/common": "2.0.0-rc.6",
"@angular/compiler": "2.0.0-rc.6",
"@angular/core": "2.0.0-rc.6",
"@angular/http": "2.0.0-rc.6",
"@angular/forms": "2.0.0-rc.6",
"@angular/router": "~3.0.0-rc.2",
"@angular/platform-browser": "2.0.0-rc.6",
"@angular/platform-browser-dynamic": "2.0.0-rc.6",
"@angular/platform-server": "2.0.0-rc.6",
"@angularclass/conventions-loader": "^1.0.12",
"@angularclass/form-validators": "^1.0.11",
"@angularclass/resolve-angular-routes": "^1.0.8",
"@angularclass/hmr-loader": "~3.0.1",
"@angularclass/hmr": "~1.2.0",
"core-js": "^2.2.0",
"rxjs": "5.0.0-beta.11",
"zone.js": "~0.6.17"}
dev-dependencies 是这样的:
"devDependencies": {
"@types/core-js": "^0.9.28",
"@types/node": "^4.0.30",
"assets-webpack-plugin": "^3.4.0",
"awesome-typescript-loader": "^2.2.1",
"cross-spawn": "^4.0.0",
"es6-promise": "^3.1.2",
"es6-shim": "^0.35.0",
"ie-shim": "^0.1.0",
"ignore-loader": "^0.1.1",
"json-loader": "^0.5.4",
"raw-loader": "^0.5.1",
"rimraf": "^2.5.4",
"string-replace-loader": "github:gdi2290/string-replace-loader",
"to-string-loader": "^1.1.4",
"ts-helpers": "github:gdi2290/ts-helpers",
"ts-loader": "^0.8.2",
"ts-node": "^1.2.2",
"typescript": "^2.0.0-beta",
"webpack": "^2.1.0-beta.22",
"webpack-dashboard": "0.0.1",
"webpack-dev-middleware": "^1.6.1",
"webpack-dev-server": "^2.1.0-beta.0"}
或用Github上的Angular2-Seed替换你的package.json
:https:// github。 COM / AngularClass / angular2种子/斑点/主/的package.json
请注意: