我正在尝试将Karma和Jasmine集成到我的前端应用程序中,该应用程序目前位于Angular4
和webpack上。我应该将所有包升级到最新版本吗?例如,我正在使用webpack1.x
,typings
,typescript 2.0.3
等...我应该将它们分别升级到webpack2
,@types
和typescript@latest
?
当我查看Angular的package.json
时,我发现他们正在使用Webpack1.x
。但{@ 1}}已被弃用,webpack鼓励大家切换到v2。
所有上述包装都与包装相关;例如,当使用webpack1
时,我应该使用typescript2
代替@types
和typings
代替1.x吗?
答案 0 :(得分:0)
您手动更新依赖项的最佳选择是运行npm update
,现在我认为没有必要,因为Angular会在必要时要求更新对等项依赖项(并且会通知您! )。
答案 1 :(得分:0)
如果您想了解当前的依赖结构:
{
"name": "proj",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^4.2.4",
"@angular/common": "^4.2.4",
"@angular/compiler": "^4.2.4",
"@angular/core": "^4.2.4",
"@angular/forms": "^4.2.4",
"@angular/http": "^4.2.4",
"@angular/platform-browser": "^4.2.4",
"@angular/platform-browser-dynamic": "^4.2.4",
"@angular/router": "^4.2.4",
"core-js": "^2.4.1",
"rxjs": "^5.4.2",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "1.3.0-rc.3",
"@angular/compiler-cli": "^4.2.4",
"@angular/language-service": "^4.2.4",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "~3.1.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.3.2",
"typescript": "~2.3.3"
}
}
并运行npm update
以更新到您的配置允许的最新软件包。