Skip to content

Instantly share code, notes, and snippets.

@outrightmental
Last active August 29, 2015 13:58
Show Gist options
  • Save outrightmental/9948329 to your computer and use it in GitHub Desktop.
Save outrightmental/9948329 to your computer and use it in GitHub Desktop.
ENOENT during "bower install" on CI [ubuntu]
{
"...",
"dependencies": {
"angular-bootstrap": "~0.10.0",
"angular-cookies": "~1.2",
"angular-flash": "~0.1",
"angular-resource": "~1.2",
"angular-route": "~1.2",
"angular-sanitize": "~1.2",
"angulartics": "~0.14",
"bootstrap-sass": "~3.0",
"components-font-awesome": "~4.0",
"es5-shim": "~2.1.0",
"jquery": "~1.11.0",
"json3": "~3.2.6",
"angular": "~1.2"
},
"devDependencies": {
"angular-mocks": "~1.2",
"angular-scenario": "~1.2"
},
"testPath": "test/client/spec"
}
{
"...",
"dependencies": {
"angular-bootstrap": "~0.10.0",
"angular-cookies": "~1.3",
"angular-flash": "~0.1",
"angular-resource": "~1.3",
"angular-route": "~1.3",
"angular-sanitize": "~1.3",
"angulartics": "~0.14",
"bootstrap-sass": "~3.0",
"components-font-awesome": "~4.0",
"es5-shim": "~2.1.0",
"jquery": "~1.11.0",
"json3": "~3.2.6",
"angular": "~1.3"
},
"devDependencies": {
"angular-mocks": "~1.3",
"angular-scenario": "~1.3"
},
"testPath": "test/client/spec",
"resolutions": {
"angular": "~1.3"
}
}
$ bower install
bower not-cached git://github.com/angular/bower-angular-cookies.git#~1.3
bower resolve git://github.com/angular/bower-angular-cookies.git#~1.3
bower not-cached git://github.com/angular/bower-angular-resource.git#~1.3
bower resolve git://github.com/angular/bower-angular-resource.git#~1.3
bower not-cached git://github.com/angular/bower-angular-route.git#~1.3
bower resolve git://github.com/angular/bower-angular-route.git#~1.3
bower not-cached git://github.com/angular/bower-angular-sanitize.git#~1.3
bower resolve git://github.com/angular/bower-angular-sanitize.git#~1.3
bower not-cached git://github.com/angular/bower-angular.git#~1.3
bower resolve git://github.com/angular/bower-angular.git#~1.3
bower not-cached git://github.com/angular/bower-angular-mocks.git#~1.3
bower resolve git://github.com/angular/bower-angular-mocks.git#~1.3
bower not-cached git://github.com/angular/bower-angular-scenario.git#~1.3
bower resolve git://github.com/angular/bower-angular-scenario.git#~1.3
bower cached git://github.com/angular-ui/bootstrap-bower.git#0.10.0
bower validate 0.10.0 against git://github.com/angular-ui/bootstrap-bower.git#~0.10.0
bower cached git://github.com/wmluke/angular-flash.git#0.1.13
bower validate 0.1.13 against git://github.com/wmluke/angular-flash.git#~0.1
bower cached git://github.com/luisfarzati/angulartics.git#0.14.15
bower validate 0.14.15 against git://github.com/luisfarzati/angulartics.git#~0.14
bower cached git://github.com/jlong/sass-twitter-bootstrap.git#3.0.2
bower validate 3.0.2 against git://github.com/jlong/sass-twitter-bootstrap.git#~3.0
bower cached git://github.com/components/font-awesome.git#4.0.3
bower validate 4.0.3 against git://github.com/components/font-awesome.git#~4.0
bower cached git://github.com/es-shims/es5-shim.git#2.1.0
bower validate 2.1.0 against git://github.com/es-shims/es5-shim.git#~2.1.0
bower cached git://github.com/jquery/jquery.git#1.11.1-beta1
bower validate 1.11.1-beta1 against git://github.com/jquery/jquery.git#~1.11.0
bower cached git://github.com/bestiejs/json3.git#3.2.6
bower validate 3.2.6 against git://github.com/bestiejs/json3.git#~3.2.6
bower not-cached git://github.com/angular/bower-angular.git#>= 1.0.7
bower resolve git://github.com/angular/bower-angular.git#>= 1.0.7
bower not-cached git://github.com/angular/bower-angular.git#1.0 - 1.2
bower resolve git://github.com/angular/bower-angular.git#1.0 - 1.2
bower download https://github.com/angular/bower-angular-cookies/archive/v1.3.0-build.2548+sha.6cd6ec6.tar.gz
bower not-cached git://github.com/angular/bower-angular.git#>=1
bower resolve git://github.com/angular/bower-angular.git#>=1
bower download https://github.com/angular/bower-angular-scenario/archive/v1.3.0-build.2548+sha.6cd6ec6.tar.gz
bower download https://github.com/angular/bower-angular-mocks/archive/v1.3.0-build.2548+sha.6cd6ec6.tar.gz
bower download https://github.com/angular/bower-angular/archive/v1.3.0-build.2548+sha.6cd6ec6.tar.gz
bower download https://github.com/angular/bower-angular-sanitize/archive/v1.3.0-build.2548+sha.6cd6ec6.tar.gz
bower download https://github.com/angular/bower-angular-route/archive/v1.3.0-build.2548+sha.6cd6ec6.tar.gz
bower download https://github.com/angular/bower-angular-resource/archive/v1.3.0-build.2548+sha.6cd6ec6.tar.gz
bower download https://github.com/angular/bower-angular/archive/v1.3.0-build.2548+sha.6cd6ec6.tar.gz
bower download https://github.com/angular/bower-angular/archive/v1.2.16-build.73+sha.102a320.tar.gz
bower download https://github.com/angular/bower-angular/archive/v1.3.0-build.2548+sha.6cd6ec6.tar.gz
bower cached git://github.com/jquery/jquery.git#2.1.1-beta1
bower validate 2.1.1-beta1 against git://github.com/jquery/jquery.git#>= 1.9.0
bower cached git://github.com/imakewebthings/jquery-waypoints.git#2.0.4
bower validate 2.0.4 against git://github.com/imakewebthings/jquery-waypoints.git#~v2.0.3
bower cached git://github.com/jquery/jquery.git#2.1.1-beta1
bower validate 2.1.1-beta1 against git://github.com/jquery/jquery.git#>=1.8
bower extract angular-cookies#~1.3 archive.tar.gz
bower extract angular-sanitize#~1.3 archive.tar.gz
bower extract angular-route#~1.3 archive.tar.gz
bower extract angular-resource#~1.3 archive.tar.gz
bower extract angular#~1.3 archive.tar.gz
bower extract angular-scenario#~1.3 archive.tar.gz
bower extract angular-mocks#~1.3 archive.tar.gz
bower extract angular#>= 1.0.7 archive.tar.gz
bower extract angular#1.0 - 1.2 archive.tar.gz
bower extract angular#>=1 archive.tar.gz
bower resolved git://github.com/angular/bower-angular-cookies.git#1.3.0-build.2548+sha.6cd6ec6
bower not-cached git://github.com/angular/bower-angular.git#1.3.0-build.2548+sha.6cd6ec6
bower resolve git://github.com/angular/bower-angular.git#1.3.0-build.2548+sha.6cd6ec6
bower download https://github.com/angular/bower-angular/archive/v1.3.0-build.2548+sha.6cd6ec6.tar.gz
bower resolved git://github.com/angular/bower-angular-sanitize.git#1.3.0-build.2548+sha.6cd6ec6
bower resolved git://github.com/angular/bower-angular-resource.git#1.3.0-build.2548+sha.6cd6ec6
bower resolved git://github.com/angular/bower-angular-route.git#1.3.0-build.2548+sha.6cd6ec6
bower extract angular#1.3.0-build.2548+sha.6cd6ec6 archive.tar.gz
bower resolved git://github.com/angular/bower-angular-mocks.git#1.3.0-build.2548+sha.6cd6ec6
bower resolved git://github.com/angular/bower-angular-scenario.git#1.3.0-build.2548+sha.6cd6ec6
bower resolved git://github.com/angular/bower-angular.git#1.2.16-build.73+sha.102a320
bower resolved git://github.com/angular/bower-angular.git#1.3.0-build.2548+sha.6cd6ec6
bower resolved git://github.com/angular/bower-angular.git#1.3.0-build.2548+sha.6cd6ec6
bower resolved git://github.com/angular/bower-angular.git#1.3.0-build.2548+sha.6cd6ec6
bower ENOTEMPTY ENOTEMPTY, rename '/tmp/ubuntu/bower/angular-6091-k1bHrG'
Stack trace:
Error: ENOTEMPTY, rename '/tmp/ubuntu/bower/angular-6091-k1bHrG'
Console trace:
Trace
at StandardRenderer.error (/home/ubuntu/nvm/v0.10.20/lib/node_modules/bower/lib/renderers/StandardRenderer.js:74:17)
at Logger.updateNotifier.packageName (/home/ubuntu/nvm/v0.10.20/lib/node_modules/bower/bin/bower:109:18)
at Logger.EventEmitter.emit (events.js:95:17)
at Logger.emit (/home/ubuntu/nvm/v0.10.20/lib/node_modules/bower/node_modules/bower-logger/lib/Logger.js:29:39)
at /home/ubuntu/nvm/v0.10.20/lib/node_modules/bower/lib/commands/install.js:27:16
at _rejected (/home/ubuntu/nvm/v0.10.20/lib/node_modules/bower/node_modules/q/q.js:808:24)
at /home/ubuntu/nvm/v0.10.20/lib/node_modules/bower/node_modules/q/q.js:834:30
at Promise.when (/home/ubuntu/nvm/v0.10.20/lib/node_modules/bower/node_modules/q/q.js:1079:31)
at Promise.promise.promiseDispatch (/home/ubuntu/nvm/v0.10.20/lib/node_modules/bower/node_modules/q/q.js:752:41)
at /home/ubuntu/nvm/v0.10.20/lib/node_modules/bower/node_modules/q/q.js:574:44
System info:
Bower version: 1.2.8
Node version: 0.10.20
OS: Linux 3.8.0-35-ref-generic x64
bower install returned exit code 1action bower install failed
@outrightmental
Copy link
Author

I originally arrived at Bower Github Issue #991 a victim of an ENOENT while running continuous integration builds on Circle CI.

The inconsistencies are loud and clear while reading this thread; I appreciated the perspective of @AnthonySteele also encountering the issue in CI- he points out that many of the fixes proffered in these comments are brittle.

I believe we are all the victim of Race Conditions as Bower attempts to solve the dependencies in our bower.json file. So I'm going to push a build through my CI with @yjaaidi fix of separating the cache and registry.

However, I also want to point out something else worth fixing (thanks infinite as always @sindresorhus ). My original bower.json had a resolutions clause that originally slipped in when, during a previous bower install, I encountered a message Unable to find a suitable version for angular and at that time I opted to bump up to 1.3 and Prefix the choice with ! to persist it to bower.json. How lazy of me!

By simply reading very very carefully the message Bower was giving me, I'm able to untangle the dependencies:

Unable to find a suitable version for angular, please choose one:
    1) angular#1.2.15 which resolved to 1.2.15 and is required by angular-cookies#1.2.15, angular-resource#1.2.15, angular-route#1.2.15, angular-sanitize#1.2.15 
    2) angular#~1.2 which resolved to 1.2.15 and is required by qurrus-web 
    3) angular#1.0 - 1.2 which resolved to 1.2.15 and is required by angular-flash#0.1.13 
    4) angular#>=1 which resolved to 1.2.15 and is required by angular-bootstrap#0.10.0 
    5) angular#>= 1.0.7 which resolved to 1.2.15 and is required by angulartics#0.14.15 
    6) angular#1.3.0-build.2549+sha.862e587 which resolved to 1.3.0-build.2549+sha.862e587 and is required by angular-mocks#1.3.0-build.2549+sha.862e587, angular-scenario#1.3.0-build.2549+sha.862e587

Prefix the choice with ! to persist it to bower.json

[?] Answer: 

The correct answer is, ^c !

So in my new bower.json I simply bump angular down to 1.2 across the board to support some of the less mature angular modules I still want to use. And this bower install runs fine on local without any error messages.

And... BOOM! Headshot. Circle CI is now OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment