How to prevent Bower from hanging up when installing angular-ui-tree? - bower

I've been trying to install angular-ui-tree using bower version 1.8.0, but it keeps hanging up on me.
I've tried the following commands:
bower install angular-ui-tree
bower install angular-ui-tree --save
bower install angular-ui-tree --save --verbose
bower install angular-ui-tree --verbose
Verbose doesn't print a stack trace, however all commands above print the info of already installed packages.
I've also tried using bower init or restoring previous versions of bower.json, but to no avail.
The original bower.json file:
{
"name": "meten",
"version": "0.0.1",
"dependencies": {
"angular": "*",
"bootstrap": "*",
"angular-animate": "*",
"angular-bootstrap": "*",
"angular-cookies": "*",
"angular-resource": "*",
"angular-route": "*",
"angular-sanitize": "*",
"angular-smart-table": "*",
"angular-touch": "*",
"angular-strap": "*",
"angular-nvd3": "*",
"papaparse": "*",
"components-font-awesome": "^4.7.0"
},
"devDependencies": {
"angular-mocks": "*"
},
"appPath": "app",
"moduleName": "metenApp",
"overrides": {
"bootstrap": {
"main": [
"less/bootstrap.less",
"dist/css/bootstrap.css",
"dist/js/bootstrap.js"
]
}
}
}
What can I do to fix bower?

Related

Why bower installs latest versions of packages and not the exact ones that I want?

Having this in bower.json
{
"name": "test",
"dependencies": {
"jquery": "2.2.4",
"html5shiv": "3.6.2"
}
}
and running
bower install
bower installing not this versions but the latest ones (jquery 3.0.0-rc1 & html5shiv 3.7.3 as for now). Why so? I don't have any other dependencies which can require the newest versions.
This is bower install log
bower cached https://github.com/jquery/jquery-dist.git#2.2.4
bower validate 2.2.4 against https://github.com/jquery/jquery-dist.git#2.2.4
bower cached https://github.com/aFarkas/html5shiv.git#3.6.2
bower validate 3.6.2 against https://github.com/aFarkas/html5shiv.git#3.6.2
bower install jquery#2.2.4
bower install html5shiv#3.6.2
jquery#2.2.4 bower_components\jquery
html5shiv#3.6.2 bower_components\html5shiv
And it's strange for me that .bower.json for html5shiv looks like this
{
"name": "html5shiv",
"version": "3.6.2",
"main": [
"dist/html5shiv.js"
],
"ignore": [
"**/.*",
"composer.json",
"test",
"build",
"src",
"build.xml"
],
"homepage": "https://github.com/aFarkas/html5shiv",
"_release": "3.6.2",
"_resolution": {
"type": "version",
"tag": "3.6.2",
"commit": "f65f9b0d776ae3b88d4c7f0b27c64e384aee47aa"
},
"_source": "https://github.com/aFarkas/html5shiv.git",
"_target": "3.6.2",
"_originalSource": "html5shiv"
}
but bower.json looks like this
{
"name": "html5shiv",
"version": "3.7.3",
"main": [
"dist/html5shiv.js"
],
"ignore": [
"**/.*",
"composer.json",
"test",
"build",
"src",
"build.xml"
]
}
The same is for jQuery. .bower.json referencing the version that I want, but bower.json referencing the latest version. And like I said, source and dist files are from the latest version.
you should use the # before the version
for example
{
"name": "test",
"dependencies": {
"jquery": "#2.2.4"
}
}
You can find more about bower here

bower fails with 'ENOTFOUND getaddrinfo ENOTFOUND vox.spacefiles'

Bower install seems to be consistently failing for multiple packages for me. I've tried removing the below (nestable) package mention and it then fails for others.
I've tried setting the git settings -
git config --global url."https://github.com/".insteadOf git#github.com:
git config --global url."https://".insteadOf git://
but still fails. I've even tried to point the nestable package to the correct github repo, but still fails. Same keeps happening for some other packages also, not for all packages though.
bower progress nestable#* remote: Compressing objects: 20% (1/5)
bower progress nestable#* remote: Compressing objects: 40% (2/5)
bower progress nestable#* remote: Compressing objects: 60% (3/5)
bower progress nestable#* remote: Compressing objects: 80% (4/5)
bower progress nestable#* remote: Compressing objects: 100% (5/5)
bower progress nestable#* remote: Compressing objects: 100% (5/5), done.
bower invalid-meta nestable is missing "main" entry in bower.json
bower invalid-meta nestable is missing "ignore" entry in bower.json
bower resolved git://github.com/dbushell/Nestable.git#4f93032cfa
bower ENOTFOUND getaddrinfo ENOTFOUND vox.spacefiles
Stack trace:
Error: getaddrinfo ENOTFOUND vox.spacefiles
at errnoException (dns.js:44:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:94:26)
From previous event:
at UrlResolver.Resolver.resolve (C:\Users\DevAdmin\AppData\Roaming\npm\node_
modules\bower\lib\core\resolvers\Resolver.js:100:6)
at PackageRepository._resolve (C:\Users\DevAdmin\AppData\Roaming\npm\node_mo
dules\bower\lib\core\PackageRepository.js:175:21)
at C:\Users\DevAdmin\AppData\Roaming\npm\node_modules\bower\lib\core\Package
Repository.js:77:29
Console trace:
Error
at StandardRenderer.error (C:\Users\DevAdmin\AppData\Roaming\npm\node_module
s\bower\lib\renderers\StandardRenderer.js:82:37)
at Logger.<anonymous> (C:\Users\DevAdmin\AppData\Roaming\npm\node_modules\bo
wer\bin\bower:110:22)
at Logger.emit (events.js:107:17)
at Logger.emit (C:\Users\DevAdmin\AppData\Roaming\npm\node_modules\bower\nod
e_modules\bower-logger\lib\Logger.js:29:39)
at C:\Users\DevAdmin\AppData\Roaming\npm\node_modules\bower\lib\commands\ind
ex.js:45:20
at _rejected (C:\Users\DevAdmin\AppData\Roaming\npm\node_modules\bower\node_
modules\q\q.js:844:24)
at C:\Users\DevAdmin\AppData\Roaming\npm\node_modules\bower\node_modules\q\q
.js:870:30
at Promise.when (C:\Users\DevAdmin\AppData\Roaming\npm\node_modules\bower\no
de_modules\q\q.js:1122:31)
at Promise.promise.promiseDispatch (C:\Users\DevAdmin\AppData\Roaming\npm\no
de_modules\bower\node_modules\q\q.js:788:41)
at C:\Users\DevAdmin\AppData\Roaming\npm\node_modules\bower\node_modules\q\q
.js:604:44
System info:
Bower version: 1.4.1
Node version: 0.12.6
OS: Windows_NT 6.3.9600 x64
Below is the bower.json
{
"name": "Demo",
"version": "0.0.0",
"authors": [
"#clo"
],
"description": "Demo",
"main": "index.html",
"keywords": [
"bootstrap",
"angular",
"admin",
"theme",
"dashboard"
],
"ignore": [
"**/.*"
],
"dependencies": {
"Flot": "flot/flot#0.8.3",
"angular-loading-bar": "0.7.0",
"angular-translate": "2.6.0",
"angular-ui-router": "0.2.13",
"angular": "1.3.13",
"angular-i18n": "1.3.13",
"angular-route": "1.3.13",
"angular-bootstrap": "0.12.1",
"angular-cookies": "1.3.13",
"angular-translate-loader-url": "2.6.0",
"angular-translate-loader-static-files": "2.6.0",
"angular-translate-storage-local": "2.6.0",
"angular-translate-storage-cookie": "2.6.0",
"angular-animate": "1.3.13",
"angular-ui-utils": "0.2.2",
"angularjs-toaster": "0.4.8",
"flatdoc": "0.9.0",
"fontawesome": "4.2.0",
"oclazyload": "0.5.2",
"screenfull": "2.0.0",
"slimScroll": "1.3.3",
"weather-icons": "1.3.2",
"moment": "2.9.0",
"chosen_v1.2.0": "https://github.com/harvesthq/chosen/releases/download/v1.2.0/chosen_v1.2.0.zip",
"flot-spline": "*",
"flot.tooltip": "0.8.4",
"ngstorage": "0.3.0",
"jquery-ui": "1.11.3",
"jqueryui-touch-punch": "*",
"seiyria-bootstrap-slider": "4.5.0",
"jquery.inputmask": "3.1.61",
"bootstrap-wysiwyg": "*",
"ika.jvectormap": "*",
"jquery": "2.1.3",
"fullcalendar": "2.2.7",
"animate.css": "3.2.1",
"fastclick": "1.0.6",
"modernizr": "2.8.3",
"animo.js": "ThrivingKings/animo.js#1.0.2",
"jquery-classyloader": "http://www.class.pm/files/jquery-classyloader.zip",
"whirl": "1.0.0",
"skycons": "darkskyapp/skycons",
"jQuery-gMap": "marioestrada/jQuery-gMap#2.1.5",
"ngDialog": "0.3.11",
"codemirror": "5.0.0",
"marked": "0.3.3",
"bootstrap-tagsinput": "0.4.2",
"ngWig": "stevermeister/ngWig#0.8.5",
"bootstrap-filestyle": "1.1.2",
"parsleyjs": "2.0.7",
"datatables": "1.10.5",
"datatables-colvis": "1.1.1",
"angular-sanitize": "1.3.13",
"angular-resource": "1.3.13",
"angular-chosen-localytics": "1.0.6",
"ng-table": "0.5.1",
"ng-table-export": "*",
"simple-line-icons": "0.1.1",
"angular-bootstrap-nav-tree": "*",
"nestable": "*",
"html.sortable": "0.1.8",
"angular-xeditable": "0.1.8",
"angular-file-upload": "1.1.5",
"ng-img-crop": "0.3.2",
"angular-ui-select": "0.9.6",
"angular-ui-codemirror": "0.2.2",
"angular-carousel": "0.3.10",
"angular-touch": "1.3.13",
"angular-dynamic-locale": "0.1.27",
"ng-grid": "2.0.14",
"ngInfiniteScroll": "1.2.0",
"Chart.js": "~1.0.1"
},
"resolutions": {
"jquery-ui": "1.11.3",
"jquery": "2.1.3",
"fullcalendar": "2.2.7",
"angular": "1.3.13",
"weather-icons": "1.3.2",
"jquery.inputmask": "3.1.61",
"angular-cookies": "1.3.13",
"angular-translate": "2.6.0",
"angular-translate-storage-cookie": "2.6.0",
"angular-loading-bar": "0.7.0",
"angular-bootstrap": "0.12.1",
"angular-translate-loader-url": "2.6.0",
"angular-translate-loader-static-files": "2.6.0",
"angular-translate-storage-local": "2.6.0",
"angular-ui-utils": "0.2.2",
"flatdoc": "0.9.0",
"screenfull": "2.0.0",
"moment": "2.9.0",
"seiyria-bootstrap-slider": "4.5.0",
"animate.css": "3.2.1",
"fastclick": "1.0.6",
"ngDialog": "0.3.11",
"codemirror": "5.0.0",
"marked": "0.3.3",
"parsleyjs": "2.0.7",
"datatables": "1.10.5",
"ng-table": "0.5.1"
}
}
EDIT
Am seeing that its failing randomly for packages
bower resolved git://github.com/angular/bower-angular-i18n.git#1.3.13
bower resolved git://github.com/FortAwesome/Font-Awesome.git#4.2.0
bower ENOTFOUND getaddrinfo ENOTFOUND vox.spacefiles
Stack trace:
Error: getaddrinfo ENOTFOUND vox.spacefiles
at errnoException (dns.js:44:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:94:26)
And if I try to do a manual install of the individual package that seems to fail, it succeeds for that.
What can be going wrong?
I also faced same issue, It's from your bower.json file.
In my case, the source URL is no more in use. I purchased a theme from here theme
So there is one dependency from the URL
"jquery-classyloader": "https://vox.space/file_download/24/jquery-classyloader.zip"
Surprisely vox.space is no more alive, So every time I got ENOTFOUND getaddrinfo ENOTFOUND vox.space vox.space
You also need to validate the existence of some dependency in your code and remove it if not necessary.

Bower not updating or installing

I've been trying to update moment.js (& several other plugins) using Bower, updating moment from 2.8.4 to 2.9.
I changed my bower.json file to be "moment": "2.x" (was ~2.8.3, I also tried ~2.8, then 2.x) & bower says it's cached and validated but running bower list shows 2.8.4 is still installed.
Whenever I try an update or install it goes through all my dependencies.
I then uninstalled moment (which worked), but now bower won't install it, bower list gives moment not installed.
I'm running the latest Bower 1.4.0.
My bower.json:
{
"name": "intranet",
"version": "1.12.35",
"authors": [
"SteB"
],
"license": "proprietary",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"jquery": "~2.1",
"jquery-migrate": "~1.2",
"modernizr": "~2.8.3",
"moment": "2.x",
"respond": "~1.4.2",
"jquery-ui": "~1.11",
"chartjs": "~1.0.2",
"rickshaw": "~1.5.1",
"gmaps": "~0.4.14",
"d3": "~3.4.11",
"bootstrap-modal": "~2.2.5",
"kbwood_countdown": "~2.0.1",
"bootstrap": "2.3.2",
"footable": "2.0.1.5",
"bootstrap-maxlength": "~1.5.7",
"flot": "~0.8.3",
"jqplot": "*",
"scrollup": "2.4.*",
"fullcalendar": "1.6.4",
"bootstrap-switch": "~2.0.5",
"es5-shim": "~4.1",
"chosen": "~1.2",
"platform": "~1.3",
"fontawesome": "~4.2.0",
"jquery.steps": "~1.1",
"jquery-cookie": "~1.4",
"typeahead.js": "~0.10.5",
"ladda": "~0.9.7"
},
"devDependencies": {},
"resolutions": {
"bootstrap": "2.3.2",
"jquery": "~2.1"
}
}
Delete yr previous "bower_components" folder or any other target installation location specified in ".bowerrc"
Use below bower.json (null to get latest version)
Run "bower install"
{
"name": "intranet",
"version": "1.12.35",
"authors": [
"SteB"
],
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"license": "proprietary",
"dependencies" : {
"jquery": null,
"jquery-migrate": null,
"modernizr": null,
"moment": null,
"respond": null,
"jquery-ui": null
}
}
Above will do fine. You need to check yr rest dependencies on bower bcz there naming seems to be incorrect

Why is bower installing files it should be ignoring?

I just setup a bower.json file for a plugin.
I registered the package using bower register <package_name> <git_repo_link> and it worked ok.
However, when I use bower install <package_name>, it pulls down everything including the .md files I've asked it to ignore.
What gives?
Below is my bower.json file:
{
"name": "restive",
"version": "1.3.0",
"homepage": "https://github.com/obihill/restive.js",
"authors": [
"Obinwanne Hill <my_email_address>"
],
"description": "Restive.JS is a Responsive + Adaptive Web Design and Development Framework.",
"dependencies": {
"jquery": ">=1.7"
},
"main": "./restive.js",
"keywords": [
"restive",
"restive.js",
"restivejs",
"responsive",
"adaptive",
"mobile",
"chess"
],
"ignore": [
"**/.*",
"*.md",
"*.txt",
"Gruntfile.js"
],
"license": "MIT"
}

install package with bower components is not correctly

I have this code in my webstorm IDE in the Terminal dialog:
bower install angular-ui-router
When I look now in my app/bower_components folder I can see the new created folder with angular-ui-router package.
But what I would have expected is also an entry in the bower.json file:
{
"name": "app",
"version": "0.0.0",
"dependencies": {
"angular": "1.2.6",
"json3": "~3.2.6",
"es5-shim": "~2.1.0",
"jquery": "~1.10.2",
"bootstrap": "~3.0.3",
"angular-resource": "1.2.6",
"angular-sanitize": "1.2.6",
"angular-route": "1.2.6",
"angular-bootstrap": "~0.10.0"
},
"devDependencies": {
"angular-mocks": "1.2.6",
"angular-scenario": "1.2.6"
}
}
I does not see the angular-ui-router anywhere!
Why is that?
You need to use the --save flag to get it in your bower.json:
bower install --save angular-ui-router

Resources