簡體   English   中英

Bower Install破壞了npm install

[英]Bower Install breaking npm install

在本地,我的bower和npm安裝工作正常,但是當我部署cricleCI時,構建失敗並給了我:

bower resolved      git://github.com/angular/bower-angular-sanitize.git#1.4.6
bower resolved      git://github.com/angular/bower-angular.git#1.4.6
bower resolved      git://github.com/angular/bower-angular.git#1.4.6
bower resolved      git://github.com/angular/bower-angular.git#1.4.6
bower ECONFLICT     Unable to find suitable version for angular

npm ERR! angular-seed@0.0.0 postinstall: `bower install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the angular-seed@0.0.0 postinstall script.
npm ERR! This is most likely a problem with the angular-seed package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     bower install
npm ERR! You can get their info via:
npm ERR!     npm owner ls angular-seed
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.14.28-031428-generic
npm ERR! command "/home/ubuntu/nvm/v0.10.35/bin/node" "/home/ubuntu/nvm/v0.10.35/bin/npm" "install"
npm ERR! cwd /home/ubuntu/dashboard
npm ERR! node -v v0.10.35
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/ubuntu/dashboard/npm-debug.log
npm ERR! not ok code 0

npm install returned exit code 1

Action failed: npm install

之前唯一改變的是我運行了Bower Update,並基於1.4.6為ngSanitize設置了分辨率,而其他所有功能均基於1.3

我能夠通過更新和設置分辨率來修復我的npm安裝,但是現在我明白了。

Chrome 43.0.2357 (Linux) dashboardApp.version module interpolate filter should replace VERSION FAILED
    Error: [$injector:modulerr] Failed to instantiate module ngMock due to:
    Error: [$injector:unpr] Unknown provider: $$asyncCallbackProvider
    http://errors.angularjs.org/1.4.6/$injector/unpr?p0=%24%24asyncCallbackProvider
        at /home/ubuntu/dashboard/app/bower_components/angular/angular.js:68:12
        at /home/ubuntu/dashboard/app/bower_components/angular/angular.js:4287:19
        at Object.getService [as get] (/home/ubuntu/dashboard/app/bower_components/angular/angular.js:4435:39)
        at Object.decorator (/home/ubuntu/dashboard/app/bower_components/angular/angular.js:4357:41)
        at /home/ubuntu/dashboard/app/bower_components/angular-mocks/angular-mocks.js:1947:12
        at Object.invoke (/home/ubuntu/dashboard/app/bower_components/angular/angular.js:4476:17)
        at runInvokeQueue (/home/ubuntu/dashboard/app/bower_components/angular/angular.js:4382:35)
        at /home/ubuntu/dashboard/app/bower_components/angular/angular.js:4391:11
        at forEach (/home/ubuntu/dashboard/app/bower_components/angular/angular.js:336:20)
        at loadModules (/home/ubuntu/dashboard/app/bower_components/angular/angular.js:4372:5)
    http://errors.angularjs.org/1.4.6/$injector/modulerr?p0=ngMock&p1=Error%3A%20%5B%24injector%3Aunpr%5D%20Unknown%20provider%3A%20%24%24asyncCallbackProvider%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.4.6%2F%24injector%2Funpr%3Fp0%3D%2524%2524asyncCallbackProvider%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fapp%2Fbower_components%2Fangular%2Fangular.js%3F1442492850000%3A68%3A12%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fapp%2Fbower_components%2Fangular%2Fangular.js%3F1442492850000%3A4287%3A19%0A%20%20%20%20at%20Object.getService%20%5Bas%20get%5D%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fapp%2Fbower_components%2Fangular%2Fangular.js%3F1442492850000%3A4435%3A39)%0A%20%20%20%20at%20Object.decorator%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fapp%2Fbower_components%2Fangular%2Fangular.js%3F1442492850000%3A4357%3A41)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fapp%2Fbower_components%2Fangular-mocks%2Fangular-mocks.js%3F1442438334000%3A1947%3A12%0A%20%20%20%20at%20Object.invoke%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fapp%2Fbower_components%2Fangular%2Fangular.js%3F1442492850000%3A4476%3A17)%0A%20%20%20%20at%20runInvokeQueue%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fapp%2Fbower_components%2Fangular%2Fangular.js%3F1442492850000%3A4382%3A35)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fapp%2Fbower_components%2Fangular%2Fangular.js%3F1442492850000%3A4391%3A11%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fapp%2Fbower_components%2Fangular%2Fangular.js%3F1442492850000%3A336%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fapp%2Fbower_components%2Fangular%2Fangular.js%3F1442492850000%3A4372%3A5)
        at /home/ubuntu/dashboard/app/bower_components/angular/angular.js:68:12
        at /home/ubuntu/dashboard/app/bower_components/angular/angular.js:4411:15
        at forEach (/home/ubuntu/dashboard/app/bower_components/angular/angular.js:336:20)
        at loadModules (/home/ubuntu/dashboard/app/bower_components/angular/angular.js:4372:5)
        at Object.createInjector [as injector] (/home/ubuntu/dashboard/app/bower_components/angular/angular.js:4297:11)
        at workFn (/home/ubuntu/dashboard/app/bower_components/angular-mocks/angular-mocks.js:2464:52)
Chrome 43.0.2357 (Linux): Executed 1 of 6 (1 FAILED) (0 secs / 0.037 secs)

我的版本(使用TeamCity)也遇到了同樣的問題。 我最終從package.json文件中的安裝后腳本中刪除了bower,並在構建過程中的一個單獨步驟中添加了bower install命令。

這是package.json中令人反感的行:

"postinstall": "bower install",

此行表明可以選擇多個角度版本:

涼亭ECONFLICT無法找到合適的彎角版本

通常應該是類似“ Unable to find a suitable version for angular, please choose one:類的東西Unable to find a suitable version for angular, please choose one:及其下面的選項列表。 由於您無法選擇任何版本,因此無法繼續進行,並且由於某些后期腳本調用了Bower安裝,因此它也會中斷npm進程。

解決此問題的最簡單方法是使用兼容的軟件包,但並非總是可能的,因為它們是由不同的人更新的。 因此,我建議您使用另一個稱為“分辨率”的涼亭功能。

這是個小解釋: https : //github.com/bower/bower.json-spec#resolutions

軟件包之間是否發生沖突時可以自動解決的依賴版本。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM