如果我尝试从npm或jspm下载angular2
npm i angular2 --save
jspm install npm:angular2
我收到angular@^2.0.0-beta.17
而不是2.0.0-rc.1
。这是否与发布候选版本中的更改有关,或者包裹是否未更新?
感谢
答案 0 :(得分:3)
从NodeJS安装:
npm install --save @angular/core @angular/compiler @angular/common @angular/platform-browser @angular/platform-browser-dynamic rxjs@5.0.0-beta.6 zone.js@0.6.12
如果您想强制使用该版本,可以添加@ 2.0.0-rc.1,如下所示:
npm install @angular/core@2.0.0-rc.1
答案 1 :(得分:0)
如angular.io文档中所述,请在依赖项中提及rc版本:
的package.json
{
"name": "angular2-quickstart",
"version": "1.0.0",
"dependencies": {
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1",
"@angular/core": "2.0.0-rc.1",
"@angular/http": "2.0.0-rc.1",
"@angular/platform-browser": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"@angular/router": "2.0.0-rc.1",
"@angular/router-deprecated": "2.0.0-rc.1",
"@angular/upgrade": "2.0.0-rc.1",
"systemjs": "0.19.27",
"core-js": "^2.4.0",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
"zone.js": "^0.6.12",
"angular2-in-memory-web-api": "0.0.9",
"bootstrap": "^3.3.6"
},
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.2.0",
"typescript": "^1.8.10",
"typings":"^0.8.1"
}
}