鉴于以下内容:
{
"name": "user_staging1",
"private": true,
"dependencies": {
"angular": "^1.4.0",
"angular-ui-router": "^0.2.0",
"angular-loading-bar": "^0.6.0"
},
"resolutions": {
"angular": "^1.4.0"
}
}
{
"name": "user_staging2",
"private": true,
"dependencies": {
"angular": "^1.4.0",
"angular-ui-router": "^0.2.0",
"angular-loading-bar": "^0.6.0"
},
"resolutions": {
"angular": "^1.4.0"
}
}
然后我怎样才能让bower只安装user_staging1?
也有人能告诉我决议区的目的是什么?
答案 0 :(得分:0)
如果只想安装一个软件包,可以使用bower install package_name
(如果要将此依赖项保存到自己的--save
文件中,可以添加bower.json
参数。
Resolutions区域有助于解决依赖项版本冲突。例如,angular-ui-router
取决于angular version 1.4.0
而angular-loading-bar
取决于angular version 1.3.0
,当您运行bower install
时,您将收到如下消息:
Unable to find a suitable version for angular, please choose one:
1) angular 1.3.0 which is required by angular-loading-bar
2) angular 1.4.0 which is required by angular-ui-router
你必须选择1或2.为了坚持这个选择并防止凉亭一直问你上述问题,你可以将你的选择添加到决议区。