Bower 0.8.5 seems to be stuck - bower

I updated from 0.8.0 (I guess) or later to 0.8.5 and bower seems stuck when i do a simple bower install. It happens on my machine and with my cloudbees hosted jenkins.
I tried to do a bower clean-cache, a bower install --force and a rm -rf ~/.bower with no luck.
It always gets stuck on copying instructions such as :
bower copying /home/bigx/.bower/cache/require/34f0965def4ee39276726c265c9162b6
or any other lib, there is no pattern.
I've got the following when I try to reinstall bower (only on my machine not on cloudbees):
npm WARN unmet dependency /usr/lib/node_modules/modulus/node_modules/prompt/node_modules/winston requires pkginfo#'0.2.x' but will load
npm WARN unmet dependency /usr/lib/node_modules/modulus/node_modules/prompt/node_modules/pkginfo,
npm WARN unmet dependency which is version 0.3.0
And here is my component.json
{
"dependencies": {
"angular": "~1.0.5",
"require": "~2.1.4",
"jquery": "~1.9.1",
"angular-sanitize": "~1.0.5",
"foundation": "http://foundation.zurb.com/files/foundation-3.2.5.zip",
"less.js": "~1.3.3",
"font-awesome": "~3.0.2"
},
"devDependencies": {
"angular-mocks": "~1.0.5"
}
}
Any idea?
Regards,
Xavier

Ok so it's a bug of the unzip library used by bower
See here: https://github.com/twitter/bower/issues/314

Related

Jenkins build failing to install pngquant

I'm running this Jenkins Image in Docker.
In one of my builds, I'm attempting to install the following packages:
json
"devDependencies": {
"#babel/core": "^7.0.0-beta.40",
"#babel/preset-env": "^7.0.0-beta.40",
"babel-loader": "^8.0.0-beta.0",
"css-loader": "^0.28.11",
"file-loader": "^1.1.11",
"html-webpack-plugin": "^3.1.0",
"image-webpack-loader": "^4.2.0",
"node-sass": "^4.8.3",
"sass-loader": "^6.0.7",
"style-loader": "^0.20.3",
"webpack": "^4.0.1",
"webpack-cli": "^2.0.13",
"webpack-dev-server": "^3.1.1"
}
However, the build keeps failing when attempting to install pngquant-bin#4.0.0:
> node-sass#4.8.3 install /var/jenkins_home/workspace/crypto-coaster/node_modules/node-sass
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.8.3/linux-x64-57_binding.node
Download complete
Binary saved to /var/jenkins_home/workspace/crypto-coaster/node_modules/node-sass/vendor/linux-x64-57/binding.node
Caching binary to /var/jenkins_home/.npm/node-sass/4.8.3/linux-x64-57_binding.node
> cwebp-bin#4.0.0 postinstall /var/jenkins_home/workspace/crypto-coaster/node_modules/cwebp-bin
> node lib/install.js
✔ cwebp pre-build test passed successfully
> gifsicle#3.0.4 postinstall /var/jenkins_home/workspace/crypto-coaster/node_modules/gifsicle
> node lib/install.js
✔ gifsicle pre-build test passed successfully
> mozjpeg#5.0.0 postinstall /var/jenkins_home/workspace/crypto-coaster/node_modules/mozjpeg
> node lib/install.js
✔ mozjpeg pre-build test passed successfully
> optipng-bin#3.1.4 postinstall /var/jenkins_home/workspace/crypto-coaster/node_modules/optipng-bin
> node lib/install.js
✔ optipng pre-build test passed successfully
> pngquant-bin#4.0.0 postinstall /var/jenkins_home/workspace/crypto-coaster/node_modules/pngquant-bin
> node lib/install.js
⚠ The `/var/jenkins_home/workspace/crypto-coaster/node_modules/pngquant-bin/vendor/pngquant` binary doesn't seem to work correctly
⚠ pngquant pre-build test failed
ℹ compiling from source
✔ pngquant pre-build test passed successfully
✖ Error: pngquant failed to build, make sure that libpng-dev is installed
at Promise.all.then.arr (/var/jenkins_home/workspace/crypto-coaster/node_modules/pngquant-bin/node_modules/bin-build/node_modules/execa/index.js:231:11)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
I've updated the Docker image, tried different versions of Node (7.9.0, 8.11.1) and keep running into the same error.
No idea how to fix get pngquant-bin working on this build.
Any assistance would be greatly appreciated.
According to this issue https://github.com/imagemin/pngquant-bin/issues/78.
I use this dockerfile to create a new image and it work fine.
FROM jenkins/jenkins:lts
USER root
RUN apt-get update && apt-get install -y gcc make libpng-dev
USER jenkins

Why does my bower_install give me an error saying my package is not found?

I have the following bower.json file:
{
"name": "user_staging",
"private": true,
"dependencies": {
"angular": "^1.4.0",
"angular-ui-router": "^0.2.0",
"angular-loading-bar": "^0.6.0"
},
"resolutions": {
"angular": "^1.4.0"
}
}
When I issue: bower install user_staging then it appears to install everything but finishes by telling me this:
C:\G\user-staging\WebUserApp>bower install user_staging
bower cached git://github.com/angular/bower-angular.git#1.3.15
bower validate 1.3.15 against git://github.com/angular/bower-angular.git#>
1.0.8
bower cached git://github.com/angular/bower-angular.git#1.4.0-rc.1
bower validate 1.4.0-rc.1 against git://github.com/angular/bower-angular.g
t#^1.4.0
bower not-cached git://github.com/angular-ui/ui-router.git#^0.2.0
bower resolve git://github.com/angular-ui/ui-router.git#^0.2.0
bower download https://github.com/angular-ui/ui-router/archive/0.2.14.tar.
z
bower progress angular-ui-router#^0.2.0 received 0.7MB of 1.7MB downloaded
43%
bower progress angular-ui-router#^0.2.0 received 0.8MB of 1.7MB downloaded
49%
bower progress angular-ui-router#^0.2.0 received 0.9MB of 1.7MB downloaded
51%
bower progress angular-ui-router#^0.2.0 received 0.9MB of 1.7MB downloaded
56%
bower progress angular-ui-router#^0.2.0 received 1.0MB of 1.7MB downloaded
60%
bower progress angular-ui-router#^0.2.0 received 1.1MB of 1.7MB downloaded
67%
bower progress angular-ui-router#^0.2.0 received 1.2MB of 1.7MB downloaded
75%
bower ENOTFOUND Package user_staging not found
It's looking for the user_staging package on the internet.
If user_staging is your project and you're running bower install in the same folder as the bower.json file then you can just run "bower install" without any arguments to install your project's dependencies.

installing modules from git zendframework 2

Is there any way to install modules by directly downloading from git-hub without php composer.phar. Because my php composer is not working.
this is the error
$ php composer.phar require webino/webino-image-thumb:2.*
./composer.json has been updated
Loading composer repositories with package information
Ignoring unknown parameter "server role"
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Can only install one of: zf-commons/zfc-admin[v0.1.0, dev-master].
- Can only install one of: zf-commons/zfc-admin[v0.1.0, dev-master].
- Installation request for zf-commons/zfc-admin 0.1.0 -> satisfiable by zf-commons/zfc-admin[v0.1.0].
- Installation request for zf-commons/zfc-admin == 9999999-dev -> satisfiable by zf-commons/zfc-admin[dev-master].
Installation failed, reverting ./composer.json to its original content.
My composer.json looks like this:
{
"name": "zendframework/skeleton-application",
"description": "Skeleton Application for ZF2",
"license": "BSD-3-Clause",
"keywords": [ "framework", "zf2" ],
"minimum-stability": "dev",
"homepage": "framework.zend.com/",
"require": {
"php": ">=5.3.3",
"zendframework/zendframework": "2.2.0",
"webino/webino-image-thumb": "1.*",
"zf-commons/zfc-admin":"0.1.0"
}
}
There are three ways you can typically install Zend 2 Modules.
Through the file system
Git
Composer
You could just run:
https://github.com/ZF-Commons/ZfcAdmin.git
to get the module. But I am unsure if it is going to work since you likely have a dependency issue that needs resolving. I would recommend sticking with composer. Please post your whole composer.json file and I'm sure that the issue can be solved.
I cannot reproduce your error.
I copy your composer.json file into an empty directory and execute composer install there. Works.
I then issue composer require webino/webino-image-thumb:2.*, and it downloads that version (2.0.0-RC1) just fine.

Bower installation directory changes: sometimes the version is appended

I have a project that uses bower.
My bower.json:
{
"name": "myproject",
"version": "0.0.0",
"dependencies": {
...
"angular-sanitize": "1.2.1",
...
Then I run bower install.
Then I can see what's installed:
➜ myproject git:(develop) ✗ ls app/bower_components/angular-sanitize/
README.md angular-sanitize.min.js bower.json
angular-sanitize.js angular-sanitize.min.js.map
But then a coworker checkouts the project, he bower installs, on his machine, this dependency is installed in
app/bower_components/angular-sanitize/bower-angular-sanitize-v1.2.1/
instead of my original
app/bower_components/angular-sanitize/.
So why does bower sometimes adds bower-angular-sanitize-v1.2.1/ to the installation folder ?
Notes: We have the same bower.json and version of bower. If I delete my bower_dependencies and reinstall, I still have the old folder.
Edit:
What I understand (after playing a while with bower install a removing bower_components, clearing bower cache etc)...
My problem is linked to how bower resolves resolutions. It seems that versions are resolved once bower prompts you with a choice for choosing a few version (jquery, angular and bootstrap).
But still, a few things that I don't understand:
On my machine, even after removing bower cache, removing bower_dependencies or copying the bower.json in a new folder, bower never prompts me about resolutions after a "bower install" (so how are they stored?)
On my coworker machine, bower prompts for resolutions only on his native system (and not when "bower install"ing in a vagrant machine).
So, I have a few more obscure points:
How does bower store the dependencies resolutions ? Is there documentation about this anywhere ? The only place I have found something is on some github issues (and by playing around with it).
My bower.json:
{
"name": "myproject",
"version": "0.0.0",
"dependencies": {
"json3": "~3.2.4",
"bootstrap-sass": "~2.3.1",
"es5-shim": "~2.0.8",
"angular-cookies": "~1.2.1",
"angular-dragdrop": "<=1.0.4",
"angular-strap": "~0.7.1",
"angulartics": "~0.8.4",
"jquery": "~1.8.3",
"underscore": "~1.4.4",
"angular": "1.2.1",
"angular-route": "1.2.1",
"angular-resource": "1.2.1",
"angular-sanitize": "1.2.1",
"angular-ui-date": "~0.0.3",
"jquery.masonry": "v2.1.08",
"bootstrap": "~2.3.1",
"angular-bootstrap": "~0.10.0",
"highcharts": "~3.0.2",
"jqueryui-timepicker-addon": "~1.4",
"moment": "~2.0.0",
"bootstrap-notify": "0.1.0",
"mjaalnir-bootstrap-colorpicker": "~1.0.0"
},
"devDependencies": {
"angular-mocks": "~1.0.7",
"angular-scenario": "~1.0.7"
},
"resolutions": {
"jquery": "~1.8.3",
"angular": "1.2.1",
"bootstrap": "~2.3.1"
}
}
We have the same problem here - it seems when the resolutions are defined within bower.json on install with empty cache and an empty bower_components directory, the package gets installed into bower_components/package/package-version whereas if you select the resolutions interactively during install, then it gets installed into bower_components/package - so if you hit that problem, clean the cache (e.g. bower cache clean), delete installed components (e.g. rm -rf bower_components/) and remove the resolutions from bower.json and then bower install.
I had the same issue. I had to go trough every dependency and install it separately, check its version and then resolving it's resolution when asked. Once it worked and didn't put the folder with the package version number, then I saved the bower.json with the right version and with the resolution (again, when asked to). It worked for me, now all bower dependencies are versioned, no "*" or "latest", and some even without the "~" at the beginning of the version.
Hope this helps you and everyone facing this problem.

Change package name with bower

I want to install two versions of the same package on my components directory.
On command line I can do something like:
bower install <name>=<package>#<version>
For example:
bower install bootstrap-new=bootstrap#2.3.2
bower install bootstrap-old=bootstrap#2.0.2
Having this .bowerrc file...
{
"directory": "vendor/assets/components",
"json": "bower.json"
}
I can see 2 directories:
vendor/assets/components/bootstrap-new
vendor/assets/components/bootstrap-old
The question is: How can I do the same thing using the bower.json file?
Use the --save flag bower install --save bootstrap-new=bootstrap#2.3.2 and you should end up with this in your bower.json:
"dependencies": {
"bootstrap-new": "bootstrap#2.3.2"
}

Resources