How to install Angular2 beta with Bower? - bower

I'm trying to install Angular2 with Bower with command bower install -S angular2 and have next messages in console:
$ bower install -S angular2
bower angular2#* cached git://github.com/angular/bower-angular.git#1.4.8
bower angular2#* validate 1.4.8 against git://github.com/angular/bower-angular.git#*
bower angular#~1.4.8 install angular#1.4.8
angular#1.4.8 bower_components/angular
My bower.json file now contains next info in dependencies section:
"dependencies": {
"angular": "angular2#~1.4.8"
}
And I have Angular 1.4.8 after that in bower_components path.
So, how to install Angular2 beta with Bower?

I have installed it from github with the command bower install git#github.com:angular/angular.git:
$ bower install git#github.com:angular/angular.git
bower angular#* not-cached git#github.com:angular/angular.git#*
bower angular#* resolve git#github.com:angular/angular.git#*
bower angular#* checkout 2.0.0-build.ffbcb26.js
bower angular#* invalid-meta angular is missing "main" entry in bower.json
bower angular#* invalid-meta angular is missing "ignore" entry in bower.json
bower angular#* resolved git#github.com:angular/angular.git#2.0.0-build.ffbcb26.js
bower angular#~2.0.0-build.ffbcb26.js install angular#2.0.0-build.ffbcb26.js
angular#2.0.0-build.ffbcb26.js bower_components/angular

I advise you not to use Bower. Bower is used to get your packages in your project folder, that's it.
Try to look up JSPM (http://jspm.io). It does a lot more than getting packages in your project. It takes care of ES6 to ES5. And loads all your packages in one time using SystemJS in your browser with just a couple lines of code.
you can install jspm using npm:
npm init
npm install (-g) jspm // -g only if you want jspm globally installed
jspm init

This worked for me, for Angular 2 bower install angular2-build

Related

How install font-awesome via bower

I have just installed font-awesome via bower:
bower install font-awesome --save
And it appears to not add the CSS at the bower build.
How can I install it?
When you use font-awesome via bower it does not include the CSS when you build it. Try using:
bower install components-font-awesome --save
It should work just fine.
In bower.json, add lines in dependencies ("components-font-awesome"):
{
"name": "example",
"version": "0.0.1",
"dependencies": {
"jquery": "~2.1.1",
"bootstrap-sass-official": ">=3.3.0",
"components-font-awesome": "^4.7.0"
}
}
Run bower install, You will get files in the bower_components folder.
check the latest or specific version of font awesome you want to install form following link
https://libraries.io/bower/Font-Awesome/tags?page=1
current latest version of fontaswesome is 5.15.3
https://libraries.io/bower/Font-Awesome/5.15.3
bower install Font-Awesome#5.15.3
people also like version 4 as well
https://libraries.io/bower/Font-Awesome/v4.7.0
bower install Font-Awesome#v4.7.0
bower install components-font-awesome --save
Use this command to install font-awesome via bower.
If the above command doesn't work that is it does not include the CSS when you build it.
Try using the following commands.
bower install components-font-awesome --save
bower install font-awesome --save
This should be following command:
bower install fontawesome --save

'bower install angular-bootstrap' fails on OS X

I posted this question to the angular-bootstrap repo and was advised to talk to the bower folks...
Here's what happens when I try to use bower to install angular-bootstrap:
Charless-MacBook-Pro:orglines charlesames$ bower install angular-bootstrap
bower cached git://github.com/angular-ui/bootstrap-bower.git#0.12.0
bower validate 0.12.0 against git://github.com/angular-ui/bootstrap-bower.git#*
bower cached git://github.com/angular/bower-angular.git#1.2.28
bower validate 1.2.28 against git://github.com/angular/bower-angular.git#>=1 <1.3.0
bower not-cached git://github.com/angular/bower-angular.git#1.3.36
bower resolve git://github.com/angular/bower-angular.git#1.3.36
bower cached git://github.com/angular/bower-angular.git#1.3.12
bower validate 1.3.12 against git://github.com/angular/bower-angular.git#*
bower ENORESTARGET No tag found that was able to satisfy 1.3.36
Additional error details:
Available versions: 1.4.0-build.3818+sha.030a42e, 1.4.0-build.3817+sha.898714d,
[snip]
This is the only module I've tried that fails. Any ideas?

Bower hangs on checkout?

OK I'm trying use bower to install a package but to no avail
"bower install threejs"
Returns:
bower not-cached git://github.com/mrdoob/three.js.git#*
bower resolve git://github.com/mrdoob/three.js.git#*
bower checkout threejs#master
and it hangs there.. why??

Upgrading Angular using Yeoman

I just installed Angular as follow:
npm install -g generator-angular # install generator
yo angular # scaffold out a AngularJS project
bower install angular-ui # install a dependency for your project from Bower
grunt test # test your app
grunt server # preview your app
grunt # build the application for deployment
That installed 1.0.7 instead of 1.0.8.
I am totally new to Yeoman. How can I upgrade 1.0.7 to 1.0.8? Is this supposed to be done manually?
Please clarify.
You can use Bower that comes with Yeoman to update the dependencies. In Bower, dependencies are listed in a ‘bower.json’ file, similar to Node’s package.json or the Ruby Gemfile.
{
"name": "myProject",
"version": "1.0.0",
"dependencies": {
"angular": "~1.0.8"
}
}
First list the installed packages:
bower list
And to update a package you use the following command:
bower update angular
If you do a bower install angular-ui you will get version 0.40 ... this is not compatible with Bootstrap 3 (if that's what you want. If you want the latest angular-ui you'll have to manually install it.

bower automatically update bower.json

I run the following commands using bower 1.0.0:
mkdir testdir;cd testdir
bower init #accept defaults
bower install jquery -s #the -s is supposed to cause update of bower.json
less bower.json
In bower.json I expect to see dependencies listed, but there are none. What is going on?
NOTE: bower install jquery --save does work
NOTE:
The option I am referring to was documented through bower help install
**-S**, --save Save installed packages into the project's bower.json dependencies
from bower help, save option has a capital S
-S, --save Save installed packages into the project's bower.json dependencies

Resources