将package.json中的所有组织/范围(@angular)依赖项安装/升级到相同版本

时间:2018-02-07 22:24:54

标签: angular npm angular-cli

我目前在package.json中有依赖项:

"@angular/animations": "^5.0.0",
"@angular/cdk": "^5.2.0",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/flex-layout": "^2.0.0-beta.12",
"@angular/forms": "^5.0.0",
"@angular/http": "^5.0.0",
"@angular/material": "^5.2.0",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/router": "^5.0.0",

是否有一些命令行选项,将所有这些选项都添加到v5.2.0

这样的事情:

npm install -S @angular/*@5.2.0  # not real, just a guess

由于版本不匹配,存在一些错误,我需要它们都是5.2.0。

1 个答案:

答案 0 :(得分:1)

您可以使用此命令使用纱线

yarn upgrade --scope @angular

更多信息在这里

https://yarnpkg.com/en/docs/cli/upgrade#toc-yarn-upgrade-scope-s-scope-latest-pattern

希望有所帮助