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
How to install angular-cli "locally" #5955
Comments
The global CLI will always use the CLI installed in your project, whichever version. So if you install globally with a new version but the project has a beta dependency (e.g.) then it will use the beta version of the CLI to perform actions on the project. |
That is not what we see. |
To run multiple different versions, which are local defined, in parallell is must have for modular development. Lets consider the following scenario: How can they make sure, angular-cli is generating exact same code for prod in "A" repo, without downgrading to 0.8 cli ? |
are there any solutions for this kind of problem and why was the ticket closed? |
Yes, we have a solution for this problem.
|
Wow, what an elegant workflow, if you work on two projects in paralell ! irony |
David, Jdang |
I see,
But all the versions have to be compatible to each other.
|
Well if all the versions have to be able to be compatible to each other then we should upgrade using a single latest version to make our life easier. |
Even I face the same problem. one of my old projects is using angular-cli 1.0.0-beta.14 and I want to work on a new project which is on angular/cli (latest version). can anyone help me on how to switch version without reinstalling? |
From https://stackoverflow.com/questions/42295591/angular-cli-lower-version-locally In package.json make a script for ng Calling "npm run-script ng build" will use the local version of the cli. It will work even if you haven't installed the cli globally. |
Thanks darrhal. This also works for "npm run-script ng serve --open" |
its Working fine, all version supported in latest one, but it will show some deprecated message, thats no problem |
darrhal, thank you very much!!! It hepled me |
One more idea, it might me useful for someone... It's possible to install certain version in parent folder. After that, |
I like the idea of not installing/using global libraries (except of course node and npm). Admittedly, you could be running a vagrant box (or container) for each dev project, then it doesn't matter much. But, for those of us who like developing on bare metal, it is much cleaner to keep local npm "environments" isolated, and mimics what python has been doing with virtualenvs for years. Making a minor correction to @jswagger 's comment. At least with npm 2.0.0+, You pass arguments to the script by including them after a naked |
"run" is an alias for "run-script" in npm, so can also do When I created a new project with Angular 6, it automatically created this "scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
} With that setup, you can do:
|
i think the only solution is to have installed Angular/cli local instead of global. |
Another option with
and it will pick up the locally installed version. |
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. |
Hi,
What does this command do? npm install @angular/cli@latest ( without -g)
Is it possible to install multiple angular-cli locally for each project on the same machine?
Currently we have 2 projects that using angular-cli.1.0.0.beta.24 and we are working on new project using latest version of angular-cli.
We don't want to spend time work update other 2 projects to work with angular-cli@1.0.0.
We just want able to work on both new and old angular-cli.
thanks
Jdang
The text was updated successfully, but these errors were encountered: