bower: .bower.json contains illegal json (sometimes)
installing package with bower i get 2 bower.json files: bower.json and .bower.json.
the .bower.json file contains:
{
"name": "jquery.serialscroll",
"version": "1.3.1",
"description": "Animated scrolling of series with jQuery",
"homepage": "https://github.com/flesler/jquery.serialScroll",
"main": [
"./jquery.serialScroll.js",
"./jquery.serialScroll.min.js"
],
"dependencies": {
"jquery": ">=1.8",
"jquery.scrollTo": ">=2.1.0"
},
"keywords": [
"slideshow",
"sequence",
"animated",
"animation",
"scrolling",
"scroll",
"prev",
"next"
],
"author": {
"name": "Ariel Flesler",
"web": "http://flesler.blogspot.com/"
},
"_release": "1.3.1",
"_resolution": {
"type": "version",
"tag": "1.3.1",
"commit": "eb3c573bee7f0fa60c46c31822f03c2479eb6b6e"
},
"_source": "git://github.com/flesler/jquery.serialScroll.git",
"_target": "*",
"_originalSource": "jquery.serialScroll"
}ll"
}
done with command install bower
and in json file:
"ignore": [
"**/.*",
"node_modules",
"bower_components"
],
"dependencies": {
"bootstrap": ">=3.3.5",
"bootstrap-touchspin": "~3.0.3",
"font-awesome": "~4.4.0",
"javascript-equal-height-responsive-rows": "*",
"jquery": ">=2.1.4",
"jquery.scrollTo": "~2.1.2",
"jquery.serialscroll": "jquery.serialScroll#~1.3.1",
"jquery-mousewheel": "~3.1.13",
"jquery-parallax": "~1.1.3",
"jquery-ui": "~1.11.4",
"malihu-custom-scrollbar-plugin": "~3.1.3",
"minimalect": "*",
"moment": "~2.10.6",
"imagesloaded": "~3.2.0"
},
"resolutions": {
"jquery.scrollTo": "~2.1.2",
"jquery": ">=1.9.0"
}
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 18 (6 by maintainers)
Commits related to this issue
- Fixing camelcase jquery dependency See https://github.com/bower/bower/issues/2067 — committed to ennosol/angular-ts-select2 by konradkiss 8 years ago
Here’s a super reduced test-case:
bower cache cleanbower installthe following:If you follow the installation of
jqueryandjQuerythrough the output below, you notice that the rightjqueryis installed first, after which bower resolves the dependency (jQuery) that is listed inangular-ts-select2. They are also installed in that order.We also see that
jQuerydoes not resolve to thejquery-distrepo, which actually contains thebower.jsonbut simply tojquery/jquery, where nobower.jsonis present. Even though I’d love to just point thejQuerypackage to the right source in the Bower registry, I think we should try to find out what exactly is causing the invalid.bower.json(below) first:Update
So if you
bower installthe following:I am getting the same error and the
.bower.jsonlooks a lot worse (see below). That leads me to believe that Bower is fetching the dependencies and (kind of simultaneously) writing to the same.bower.json. This kind of makes sense, because it is installing the dependencies into the same directory. Considering the original issue can be replicated by runningbower installtwice, I wonder if this happens everytime multiple dependencies depend on the same package. The firstbower.jsonreported in this issue also has no dependencies that requirejQuery, so it not related to that alone!By the looks of the responses, you should check if your dependencies have capitals and remove them!
Im closing my issue, no longer had this problem and bower popularity seems in decline, since webpack2 and browserify makes separation no longer needed.
If you manually copy the full module from a separate install into your web env, your build process should skip trying to download the bad module via bower. That’s what we did.
On Tue, Mar 8, 2016 at 12:40 AM, Dan Caragea notifications@github.com wrote:
|<ipp McMichael Senior Front End Software Engineer kmcmichael@twistbioscience.com
Any news on this? Or workaround/patch? Currently I simply cannot init my project…😦