-
Notifications
You must be signed in to change notification settings - Fork 12k
How to Use Angular4 and Angular5 on same computer? #9239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The global install delegates to the local project install so what you are describing already happens. Each project has its own version of the CLI and Angular itself which is dictated by the project’s package dependencies. There’s no action required to enable this behavior. |
hmmm...I guess I am missing something because the commands that now install and use Angular5, are the same ones that used to give you Angular4...so how do I specify for any new project whether I want Ang4 or Ang5 (or this summer Ang6, etc...). And does this capability require any particular version of angular-cli? |
The CLI will generate a project using the latest stable version of Angular. There's not really a compelling use case for supporting and maintaining the generation projects using old versions of Angular. The dependencies of the project can be altered to use Angular 4 (or even 2), if necessary. The latest current version of the CLI supports building Angular version 2 and up. |
The compelling use case is the real world. So, even if it is not a turnkey cmd-line option on |
Outside of All previous versions of the CLI and Angular are available via It's also important to note that Angular 4.0 and 5.0 are incremental improvements over Angular 2.0. This is in stark contrast to the difference between AngularJS and Angular. |
ok, so do I need to |
I think you are missing some key points in how angular/cli works: ng new is only used when creating a new project. A project created with ng new will have the version of angular it was created with from there on, no matter which version of angular cli you install globally, this is because a local version of angular/cli is already installed into that project (look at the package.json of a ng newed project and you will see) So the project folder after this is totally self contained and has no connection to the version of angular cli you use globally. (other than as mentioned, the global ng commands will act on the folder you are standing in and trigger the same commands in the local angular cli) However if a newly hired developer is supposed to work on an existing project that uses an old version of angular, that developer should never do ng new, he/she should just get the project folder from source control or share or however you distribute the project, and then do npm install within the project, then that project will continue to use the angular version defined in the project. The only time you have a problem is if you need to start a completely new project with an old version of angular. |
Yes, I was/am missing those points because of the large amount of confusion and blind leading the blind online regarding this question (see below). That is why I wanted a definitive documentation right from the horse's mouth. With some of these below talking about directly running cmds from https://stackoverflow.com/questions/41428325/managing-several-versions-of-angular-cli?rq=1 |
Hello, we reviewed this issue and determined that it doesn't fall into the bug report or feature request category. This issue tracker is not suitable for support requests, please repost your issue on StackOverflow using tag If you are wondering why we don't resolve support issues via the issue tracker, please check out this explanation. Closing this as it's something we support in the CLI already. |
The similar case for us is that: we would like to use another component which only works under ng5 at this point, but we get the ng6. Any suggestions? |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
angular-cli (and all its collection of satellite installs) seems to require only one version of Angular development to be going on, on the same computer, especially given that everyone shows installing it globally, and things break when arbitrarily moving existing apps to newer versions of all those npm installs.
So, whether I am mistaken about that or not, where is the documentation that shows how to use the same computer for simultaneously developing different projects with different versions of Angular?
Versions
I happen to be using 1.5.1 but the issue is not particularly version specific.
Desired behavior
Would like it to be completely obvious and turnkey which version of Angular is being invoked for a particular project build/serve,
and, different projects can use different versions of Angular.
Ideally, the global installation of angular-cli should be just fine with that, but otherwise document what needs to be installed where/how/global/dev/whatever to support multiple versions of Angular on the same computer.
The text was updated successfully, but these errors were encountered: