Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

angular-cli lower version locally

I have a recent version of angular-cli installed globally. The version is as follows.

C:\Users\W055013\kumar\learn\rx>ng --version
As a forewarning, we are moving the CLI npm package to "@angular/cli" with the next release,
which will only support Node 6.9 and greater. This package will be officially deprecated
shortly after.

To disable this warning use "ng set --global warnings.packageDeprecation=false".


                             _                           _  _
  __ _  _ __    __ _  _   _ | |  __ _  _ __         ___ | |(_)
 / _` || '_ \  / _` || | | || | / _` || '__|_____  / __|| || |
| (_| || | | || (_| || |_| || || (_| || |  |_____|| (__ | || |
 \__,_||_| |_| \__, | \__,_||_| \__,_||_|          \___||_||_|
               |___/
angular-cli: 1.0.0-beta.28.3
node: 6.9.1
os: win32 x64

Recently I started to experiment with ng2-ngrx-store. So I downloaded a few sample applications. When I try to build them I get the following errors:

 C:\Users\W055013\kumar\learn\rx\staffer\staffer-ng2-ngrxstore>ng build
    As a forewarning, we are moving the CLI npm package to "@angular/cli" with the next release,
    which will only support Node 6.9 and greater. This package will be officially deprecated
    shortly after.

To disable this warning use "ng set --global warnings.packageDeprecation=false".


It seems like you're using a project generated using an old version of the Angular CLI.
The latest CLI now uses webpack and has a lot of improvements including a simpler
workflow, a faster build, and smaller bundles.

To get more info, including a step-by-step guide to upgrade the CLI, follow this link:
https://github.com/angular/angular-cli/wiki/Upgrading-from-Beta.10-to-Beta.14

One solution is to migrate the sample applications to the recent version of angular-cli. However I do not want to do that as I just want to learn ng2-ngrxstore.

So, my question is ... can I install a lower version of angular-cli locally so that I can run the sample application. If yes , how ? if no can I get ngrxstore sample applications with the new angular-cli version somewhere....

Thanks in advance for your help...

like image 807
burbak Avatar asked Feb 17 '17 10:02

burbak


People also ask

How to update angular CLI version globally?

To update Angular CLI version globally in your system use the below commands First you need to uninstall the existing angular cli packages followed by npm cache verify command to clear the cache related problems. And the install the Angular CLI version again by using npm install -g @angular/cli@latest

How to install lower version of angular on your system?

How to install lower version of angular or another version of angular on your system make sure updated version is installed globally npm install g @angular/cli

What is the difference between local and global version of angular?

So it updates the global version of packages which are not accessible by local projects/ directories. When we try to create a new Angular project y running the new command as follows: Your global Angular CLI version (8.0.2) is greater than your local version (7.3.8). The local Angular CLI version is used.

How to fix angular CLI not installing on Mac?

First you need to uninstall the existing angular cli packages followed by npm cache verify command to clear the cache related problems. And the install the Angular CLI version again by using npm install -g @angular/cli@latest. If you are using MAC or linux systems you might need to add the prefix before npm.


2 Answers

You can use the angular-cli version that is a dev-dependency for the specific project by using npm "scripts"

When you run 'ng serve' from command line, it uses your global package. But if you add a "script" to "package.json" of each application, "start":"ng serve" and run 'npm start' this will actually use the local angular-cli ( in that project's node_modules folder)

I believe that "start" scripts is default in angular-cli applications

like image 107
Ahmed Musallam Avatar answered Sep 26 '22 06:09

Ahmed Musallam


do npm start on your project which is equivalent to ng serve. it will run your local angular version.

like image 39
Vijay Mishra Avatar answered Sep 25 '22 06:09

Vijay Mishra