Bower: Updating Angular and Its Dependencies - angularjs

So I'm using a pretty old version (1.2) of Angular in my app and would like to update it to at least 1.3.5. There's a bunch of other packages in my bower.json file that depend on that version of Angular.
bower update doesn't seem to do the trick.
Is there a quick and easy way to upgrade my version of Angular and have the rest of my packages follow suit?
Any help is appreciated. Thanks in advance!

Run this command first:
npm install bower-update -g
then run:
bower-update

Related

What command do I upgrade my angular 1.x version to the last 1.x version?

First, I am unsure how checking the version of Angular because if I type the command, "Angular -v" it says "Angular: command not found". I think someone told me that it was version 1.5, but I want it to be 1.6 or whatever the latest angular 1 version is available to upgrade.
Lastly, what is the command to update the version to the latest version of Angular 1.x? Is it, "npm install [NAME OF ANGULAR 1.X PACKAGE]"?
You can use the npm update as per the npm documentation:
https://docs.npmjs.com/all
You can run an npm outdated first to see what is in need of updating and then run the npm update, but some combination in the command prompt of...
npm update
npm outdated
... should at least get you started.
As for your version of angular somewhere in your project you have to have the angular source code thaht will include the license version, or a link to a cdn or the like for it. Maybe search the project for something like "license AngularJS v".
The uninstall/reinstall works too, but you might need to do it for more than just the angular package. Even with the update method it is likely that you'll need to look into dependencies and other packages that will become outdated.

Angular installation

I want to install Angular version 4.* on my windows 7.
I am currently using Angular version 1.6.*
I tried following command
npm install #angular/{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router,animations}#next --save
But its not working
Can any one please guide me to install and to create angular 4 project..
Make sure you have node version above 6.9 and npm above 3
Check the version by using node --version and npm --version
Install angular cli using npm install -g #angular/cli
-g installs the angular globally on your system and you just have to run this command only once
Create the angular project using ‘ng new angularprojectname’
Go to that project folder and check the angular version by ‘ng -v’
Upgrade this version to angular 4 by running this command-
For Windows-
npm install #angular/common#next #angular/compiler#next #angular/compiler-cli#next #angular/core#next #angular/forms#next #angular/http#next #angular/platform-browser#next #angular/platform-browser-dynamic#next #angular/platform-server#next #angular/router#next #angular/animations#next --save
For Linux/Mac-
npm install #angular/{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router,animations}#next --save
Make sure to upgrade the typescript version by running command-
npm install typescript#2.2.1 --save
Ignore whatever warning it shows up and now check the angular version by ‘ng -v’
The version has changed from 2.2.4 to 4.1.0
You can also check all the info about your angular cli in package.json file.
You just need to install npm -g install angular-cli
And write sudo if you are using mac or ubantu
Then go to directory where you want project and then ng new PROJECTNAME
It will create project
Hope it helps you
I am adding this to update the answer.
If you want to install the latest angular version others answers are for you.
If you want to install a specific version of angular (Get your version number here)
You should use the below command.
npm install -g #angular/cli#VERSION_NUMBER
for example, if you want to install angular 1.4.9 command should be like below
npm install -g #angular/cli#1.4.9
I have also found the same issue while installing.
Please Do check npm and nodejs version and upgrade them.
I'd like to recommend node v6.x.x and npm 4.x.x or higher
There are many ways to structure AngularJS applications. When you begin to upgrade these applications to Angular, some will turn out to be much more easy to work with than others. There are a few key techniques and patterns that you can apply to future proof apps even before you begin the migration.
Follow the AngularJS Style Guide
Using a Module Loader
Migrating to TypeScript
Using Component Directives
Upgrade with ngUpgrade
Or up can follow the official document of Angular
For installing Angular 4 follow below simple steps:
Install node.js and npm(they are required dependencies. npm is automatically installed on installing node.js). You can install it
from here
With the help of npm install angular CLI. Type the following command in your command prompt: npm install -g #angular/cli
If you are still facing some problems you have to install git. You can install it from here
Now to create an angular 4 project using Angular CLI type the following command:
ng new [Project_Name]
This will create an Angualr 4 project.
5.To start the server and get your project up and running type following in command line:
ng serve
Remember you should be inside the project folder before starting the server. Hope this helps.
You have some libraries, Like
angular-material, angular-cdk`
etc...
Add all those and Try.
It will work for sure.
And you will be able to run the project
Install angular cli globally.
npm install -g #angular/cli
Get git pull from repository:-
[https://github.com/blazehub/ng-cli-starter.git]
to get ready made production ready project structure.
If you are looking for latest angular version use this command to install
npm -g install #angular/cli

ngBoilerplate upgrade to angularJS 1.5.5

Recently, I would like to start a new project. So, I clone https://github.com/ngbp/ngbp framework as a starting point.
I have follow the steps to start. And the angular version was installed as 1.2.29.
I would like to install 1.5.5.
I tried this commend:
$ bower install angular#1.5.5
But, it stop here...
http://i.stack.imgur.com/Cfr7W.png
I have tried commend
$ bower cache clean
But it shows the same result.
Any one can help me=[.
Thank you so much!!!

Angulars - Choose which version of angularjs Yeoman must install

My question is very basilar, but I didn't found anything in the web: how can I tell Yeoman to use a specific version of Angularjs instead of the latest available?
Thanks
You can force Angular's requested version in generated bower.json file, and then running bower install...
Then please be sure all other dependencies in bower.json file are not broken by the previous downgrade, possibly downgrading other libraries versions, too...

How do I reference angular-latest installed by bower?

I have installed AngularJS using bower, by calling:
$ bower install angular-latest
Now I wonder how to integrate AngularJS into my html file. Apparently, there is neither an angular[.min].js file nor an index.js file as suggested by the bower documentation.
I can't imagine that I am the first person on earth to discover this problem, but unfortunately I did not find any clues on this on Google (but perhaps I only used the wrong terms for searching).
Any idea of how to include AngularJS?
Okay, I found the solution:
$ bower install angular
And everything is fine ...
What you installed with
$ bower install angular-latest
was only the latest source code. You need to actually build AngularJS.
First, you need to install all of the following dependencies if you haven't already:
Git
Node.js
Java
Grunt
Bower
Second, change into the angular.js directory.
Then, install node.js dependencies and bower components:
$ npm install
$ bower install
Finally, you're ready to build your package:
$ grunt package
In the resulting build directory, you'll find
angular.js — The non-minified angular script
angular.min.js — The minified angular script

Resources