当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - Bower Error: Unable to find suitable version for angular

问题描述:

I'm using bower in Visual Studio 2012 and I could migrate most JS/CSS libraries from NUGET to Bower but there's a few I cannot update, getting the same error on all. I'm new to bower so there might be something I'm missing maybe? I did tried to add the resolutions to my bower.json but still give me similar errors.

My bower.json

{

"name": "Web",

"version": "0.0.0",

"ignore": [

"**/.*",

"node_modules",

"bower_components",

"test",

"tests"

],

"dependencies": {

"angular": "~1.3.11",

"bootstrap": "~3.3.2",

"jqueryui": "~1.11.2",

"requirejs": "~2.1.15",

"fontawesome": "~4.3.0",

"angular-smart-table": "~1.4.9",

"angularjs-toaster": "~0.4.10",

"angular-local-storage": "~0.1.5",

"angular-translate": "~2.5.2",

"angular-cookies": "~1.3.11",

"angular-translate-loader-static-files": "~2.5.2",

"angular-loading-bar": "~0.6.0",

"oclazyload": "~0.5.2"

}

}

This is for angular-translate-storage-cookie

PM> bower install angular-translate-storage-cookie -save

bower angular-translate-storage-cookie#* cached git://github.com/PascalPrecht/bower-angular-translate-storage-cookie.git#2.5.2

bower angular-translate-storage-cookie#* validate 2.5.2 against git://github.com/PascalPrecht/bower-angular-translate-storage-cookie.git#*

bower angular-cookies#~1.2.26 cached git://github.com/angular/bower-angular-cookies.git#1.2.28

bower angular-cookies#~1.2.26 validate 1.2.28 against git://github.com/angular/bower-angular-cookies.git#~1.2.26

bower angular#1.2.28 cached git://github.com/angular/bower-angular.git#1.2.28

bower angular#1.2.28 validate 1.2.28 against git://github.com/angular/bower-angular.git#1.2.28

bower angular#* cached git://github.com/angular/bower-angular.git#1.3.11

bower : bower ECONFLICT Unable to find suitable version for angular

At line:1 char:1

+ bower install angular-translate-storage-cookie -save

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : NotSpecified: (bower ...ion for angular:String) [], RemoteException

+ FullyQualifiedErrorId : NativeCommandError

angular-translate-storage-local

PM> bower install angular-translate-storage-local -save

bower angular-translate-storage-local#* cached git://github.com/PascalPrecht/bower-angular-translate-storage-local.git#2.5.2

bower angular-translate-storage-local#* validate 2.5.2 against git://github.com/PascalPrecht/bower-angular-translate-storage-local.git#*

bower angular-translate-storage-cookie#~2.5.2 cached git://github.com/PascalPrecht/bower-angular-translate-storage-cookie.git#2.5.2

bower angular-translate-storage-cookie#~2.5.2 validate 2.5.2 against git://github.com/PascalPrecht/bower-angular-translate-storage-cookie.git#~2.5.2

bower angular-cookies#~1.2.26 cached git://github.com/angular/bower-angular-cookies.git#1.2.28

bower angular-cookies#~1.2.26 validate 1.2.28 against git://github.com/angular/bower-angular-cookies.git#~1.2.26

bower angular#1.2.28 cached git://github.com/angular/bower-angular.git#1.2.28

bower angular#1.2.28 validate 1.2.28 against git://github.com/angular/bower-angular.git#1.2.28

bower angular#* cached git://github.com/angular/bower-angular.git#1.3.11

bower angular#* validate 1.3.11 against git://github.com/angular/bower-angular.git#*

bower : bower ECONFLICT Unable to find suitable version for angular

At line:1 char:1

+ bower install angular-translate-storage-local -save

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : NotSpecified: (bower ...ion for angular:String) [], RemoteException

+ FullyQualifiedErrorId : NativeCommandError

angular-bootstrap

PM> bower install angular-bootstrap -save

bower angular-bootstrap#* cached git://github.com/angular-ui/bootstrap-bower.git#0.12.0

bower angular-bootstrap#* validate 0.12.0 against git://github.com/angular-ui/bootstrap-bower.git#*

bower angular#>=1 <1.3.0 cached git://github.com/angular/bower-angular.git#1.2.28

bower angular#>=1 <1.3.0 validate 1.2.28 against git://github.com/angular/bower-angular.git#>=1 <1.3.0

bower angular#* cached git://github.com/angular/bower-angular.git#1.3.11

bower : bower ECONFLICT Unable to find suitable version for angular

At line:1 char:1

+ bower install angular-bootstrap -save

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : NotSpecified: (bower ...ion for angular:String) [], RemoteException

+ FullyQualifiedErrorId : NativeCommandError

angularAMD

PM> bower install angularAMD -save

bower angularAMD#* cached git://github.com/marcoslin/bower-angularAMD.git#0.2.1

bower angularAMD#* validate 0.2.1 against git://github.com/marcoslin/bower-angularAMD.git#*

bower angular#~1.2.0 cached git://github.com/angular/bower-angular.git#1.2.28

bower angular#~1.2.0 validate 1.2.28 against git://github.com/angular/bower-angular.git#~1.2.0

bower angular#* cached git://github.com/angular/bower-angular.git#1.3.11

bower : bower ECONFLICT Unable to find suitable version for angular

At line:1 char:1

+ bower install angularAMD -save

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : NotSpecified: (bower ...ion for angular:String) [], RemoteException

+ FullyQualifiedErrorId : NativeCommandError

网友答案:

You should provide version with each command :-

UPDATE with compatible version

  bower install angular-bootstrap#0.1.0 --save
  bower install angularAMD#0.0.1 --save
    ..etc
网友答案:

After some more research and trying I found out a solution and is simple. Instead of running bower install library -save I did added the latest versions of the libraries directly to my bower.json and added the resolutions as squiroid said on his answer as follow

{
  "name": "Web",
  "version": "0.0.0",
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components",
    "test",
    "tests"
  ],
  "dependencies": {
    "bootstrap": "~3.3.2",
    "jqueryui": "~1.11.2",
    "requirejs": "~2.1.15",
    "fontawesome": "~4.3.0",
    "oclazyload": "~0.5.2",
    "angular": "~1.3.11",
    "angular-route": "~1.3.11",
    "angular-cookies": "~1.3.11",
    "angular-bootstrap": "~0.12.0",
    "angular-local-storage": "~0.1.5",
    "angular-loading-bar": "~0.6.0",
    "angular-smart-table": "~1.4.9",
    "angular-translate": "~2.5.2",
    "angular-translate-loader-static-files": "~2.5.2",
    "angular-translate-storage-cookie": "~2.5.2",
    "angular-translate-storage-local": "~2.5.2",
    "angularjs-toaster": "~0.4.10",
    "angularAMD": "~0.2.1"
  },
  "resolutions": {
    "angular": "~1.3.x",
    "angular-cookies": "~1.3.x"
  }
}

Then you just run bower install and they will be added because are missing.

网友答案:

I got the same problem but when I run bower update. It did the trick for me.

分享给朋友:
您可能感兴趣的文章:
随机阅读: