bower install fails silently on any package - bower

I can install Bower and it seems just fine via npm. I create a bower.json file using bower init, and add dependencies. Then when I use bower install, literally nothing happens in the terminal. I can use bower update to install packages, but bower install does not work and I cannot get any error to produce, even with --verbose. I've included bower.json below:
{
"name": "testing",
"version": "0.0.0",
"authors": [
"AJ"
],
"main": "index.html",
"license": "private",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"polymer": "Polymer/polymer#~0.3.0",
"core-menu": "Polymer/core-menu",
"core-ajax": "Polymer/core-ajax"
}
}
edit: using 1.3.3, but I've reproduced this using 1.3.2 as well

Try removing the bower_components directory and running bower install again.
Edit:
This is also related to a circular dependency in Polymer see: https://github.com/bower/bower/issues/1324#issuecomment-44436595

Related

Can not install older version of Electron through package.json

Since the current VS code doesn't support Electron v1.6, so I have to downgrade my Electron version. However, I found that I can not install the old version of Electron by giving the version number in the package.json file. The following is my configuration:
{
"name": "Example",
"version": "1.0.0",
"description": "",
"main": "./app/main.js",
"scripts": {
"postinstall": "install-app-deps",
"start": "electron ."
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"electron-builder": "^15.5.1",
"electron": "^1.4",
"electron-rebuild": "^1.5.7"
},
"dependencies": {
"jquery": "^3.1.1",
"sqlite3": "^3.1.8"
}
}
The output of the npm install is the following:
And I run the following command to check the version of Electron:
node_modules/.bin/electron -v
and the output is '1.6.2' which is the latest version of Electron.
What's more interesting is that I can install the old version of Electron successfully by directly running the following command:
npm install electron#1.4
So I want to if there is anything wrong in my package.json file which caused this problem. And if so, how can I fix it.
Actually, the Electron version 1.6 satisfies "^1.4" because the caret tells NPM the minimal version of the package to install.
As also written in an answer to the Microsoft issue on GitHub, you might use "1.4" or "~1.4.0" in order to get Electron 1.4 or any other 1.4.x version (the tilde is for minimal minor releases as shown in the NPM documentation for the cli-based update of packages).

aurelia-dialog error with the release version and CLI

I'm facing a problem when using the new aurelai release :
I created a new app using : au new myApp
I installed aurelia-dialog via npm
When I import aurelia-dialog and try to run the app using
au run --watch
I get htis error :
[Error: ENOENT: no such file or directory, open 'C:\src\ai-dialog.js']
Any idea ?
The reason this is happening is because the package is a CommonJS package.
See: http://aurelia.io/hub.html#/doc/article/aurelia/framework/latest/the-aurelia-cli/10
Edit your aurelia_project/aurelia.json file from
"dependencies": [
"aurelia-dialog"
]
to
"dependencies": [
{
"name": "aurelia-dialog",
"path": "../node_modules/aurelia-dialog/dist/amd",
"main": "aurelia-dialog"
}
]
and that should solve your problem.
I got into the same issue. I have installed the aurelia dialog using below npm command
npm install aurelia-dialog --save
then just adding below dependencies to aurelia.json, resolved the issue
{
"name": "aurelia-dialog",
"path": "../node_modules/aurelia-dialog/dist/amd",
"main": "aurelia-dialog"
}
Things have changed a little bit since the release of aurelia-dialog 2.0.0.
The block you need to add in the aurelia.json dependencies definition is now the following one:
"dependencies": [
{
"name": "aurelia-dialog",
"path": "../node_modules/aurelia-dialog/dist/amd",
"main": "aurelia-dialog",
"resources": ["**/*.js"]
}
]

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

Installed bower dependencies not on latest commit

I have a git project which contains a bower.json file which contains several dependencies. It looks like this:
//module1
"dependencies": {
"devbridge-autocomplete": "devbridge/jQuery-Autocomplete#~1.2.21",
"backbone": "~1.2.1",
"underscore": "~1.8.3",
"jquery": "~2.1.4",
"module2": "gitUser/module2",
"module3": "gitUser/module3"
}
problem is when I run bower install --save gitUser/module1 bower does not pull the latest commits from github, and only pulls the initial commit.
bower.json of module2 and 3 are essentially similar:
{
"name": "module2",
"main": "module2.js",
"version": "0.0.0",
"authors": [
"gitUser <gitUser#gitUser.com>"
],
"moduleType": [
"amd"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"directory/bower_components",
"test",
"tests"
]
}
the cloned repositories hidden .bower.json looks like:
{
"name": "module2",
"_cacheHeaders": {
"Content-Type": "text/html; charset=utf-8"
},
"main": "index",
"_source": "https://github.com/gitUser/module2",
"_target": "*",
"_originalSource": "https://github.com/gitUser/module2"
}
I have also unsuccessfully tried installing dependencies in module1 by:
bower install --save gitUser/module2#latest
I have also tried adding git tags to each sub module, but this also did not work.
I saw this issue, so the tagging should not matter.
Any assistance appreciated!
If you want the latest commit from a specific branch:
bower install --save gitUser/module2#specific_branch_name
If you want a specific commit:
bower install --save gitUser/module2#specific_commit_id

Bower hangs after checkout step of Install command.

I'm a github enterprise user and I'm using bower to point an internal repository to manage dependencies.
I have set up a repo and included a bower.json file in the root directory. It looks like this:
{
"name": "Axis",
"main": "Axis.js",
"version": "0.0.0",
"authors": [
"Nick Randall"
],
"description": "Chart Axis",
"keywords": [
"d3",
"d3.chart",
"axis"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"d3": "~3.4.6",
"d3.chart": "~0.2.0",
"lodash": "~2.4.1"
}
}
I'm trying to install the repo above as a dependency in a new project using "bower install Org/Axis" and the process hangs after the "Checkout" step. Am I doing something wrong or is this a bug?
My .bowerrc file looks like this:
{
"shorthand-resolver": "https://git.company.com/{{owner}}/{{package}}'.git"
}
and this is the response I get from the command line:
bower Axis#* not-cached https://git.company.com/Org/Axis.git#*
bower Axis#* resolve https://git.company.com/Org/Axis.git#*
bower Axis#* checkout v1.1.1
after that it just hangs there and never progresses.
About a year ago, there was an issue with bower hanging due to problems with the version of unzip. To see if your hanging may have the same cause you might try to install one of the dependencies individually. If an individual install doesn't hang you may have the same issue as before -- it occurred in the presence of certain combinations of node version and bower version. To try and load individually, consider for example:
bower install https://github.com/lodash/lodash.git
It turns out that this was a dumb mistake. I had my .bowerrc in the wrong location. Once I moved it to the root of my project, everything started working. I hope this helps somebody else!

Resources