0

I have installed node 6.10.0 in my system, and I further want to install angular 4. I am using the command npm install -g @angular/cli@1.4 But i am unable to do so. Need some suggestions. PS: I use windows

1 Answers1

0

First install latest version from your cli. Then Specify the version you want in the 'dependencies' section of your package.json. For example if you want Angular 4.3.4 then you can edit you package.json file like

"dependencies": {
    "@angular/animations": "^4.3.4",
    "@angular/common": "^4.3.4",
    "@angular/compiler": "^4.3.4",
    "@angular/core": "^4.3.4",
    "@angular/forms": "^4.3.4",
    "@angular/http": "^4.3.4",
    "@angular/platform-browser": "^4.3.4",
    "@angular/platform-browser-dynamic": "^4.3.4",
    "@angular/router": "^4.3.4",
     ...........................
     ...........................
    }

Also change your devDependencies

"devDependencies": {
  "@angular/compiler-cli": "^4.3.4",
  "@angular/language-service": "^4.3.4",
  .............
}

now run npm install

 npm install

After finishing install you should see your version by ng -v command like this

Angular CLI: 1.6.3
Node: 9.3.0
OS: linux x64
Angular: 4.4.6
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, tsc-wrapped

@angular/cli: 1.6.3
@angular-devkit/build-optimizer: 0.0.38
@angular-devkit/core: 0.0.25
@angular-devkit/schematics: 0.0.48
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.3
@schematics/angular: 0.1.13
@schematics/schematics: 0.0.13
typescript: 2.4.2
webpack: 3.10.0

PS: From your question, you have mentioned npm install -g @angular/cli@1.4 there is no 1.4 version when you are trying to install angular 4

UI_Dev
  • 3,317
  • 16
  • 46
  • 92