4

I am trying to install angular cli but i am getting below the message. How can i install specific angular cli version for nodejs v6.x.x.which angular cli verion is suitable for nodsjs v6.x.x?

You are running version v6.x.x of node.js, which is not supported by angular CLI v6. The official Node.js version that is supported is 8.x and greater.
Apple Orange
  • 646
  • 5
  • 12
  • 27

3 Answers3

18

I think the last version compatible with node 6.9.x is @angular/cli@6.0.8 Check this for all versions

npm uninstall -g @angular/cli
npm cache clean --force
npm install -g @angular/cli@6.0.8
Tim Martens
  • 1,464
  • 9
  • 18
  • This will not add `@angular/cli` to the package.json correctly. `npm install` will add per default installed packages to `dependencies`. `@angular/cli`, however, is a `devDependency`. – kedenk Aug 01 '18 at 08:33
  • So..Which solution is better to resolve this issue..Please tell me..I can not do anything without angular cli here – Apple Orange Aug 01 '18 at 08:35
  • @kedenk Question is about installing @angular/cli, not about a version in a project – Tim Martens Aug 01 '18 at 08:39
  • TimMartens: Any solution is there? – Apple Orange Aug 01 '18 at 09:12
  • 1
    @AppleOrange not sure here, I don't have an old version of node on my machine, so I can't test. I found some other resources saying that CLI version 6 requires requires Node 8.9+. So maybe you can try same steps but with `npm install -g @angular/cli@1.7.4`. Also, add `--force` to `npm cache clean` – Tim Martens Aug 01 '18 at 09:25
  • Tim:Thanks..Checked but version changed – Apple Orange Aug 01 '18 at 09:34
  • v8.16.0 of Node.js was not supported with Angular CLI 8.0+, but Angular 6.0.8 is working. – vidur punj Aug 02 '19 at 10:50
1

You have to adjust the version of angular-cli in your package.json file. There should be an entry for the angular-cli. Take a look at the following image. Under devDependenciesyou can see @angular/cli with the version. Change this version and invoke again npm install.

enter image description here

The package.json is located in the root directory of you angular project. It is automatically generated when you did npm init.

kedenk
  • 659
  • 6
  • 9
  • kedenk:So i want to change only "@angular/cli":"~1.7.0" rite? then nmp install? – Apple Orange Aug 01 '18 at 08:26
  • Yes, but maybe you have to take a look at other dependencies because of compatibility. If you change the version of `@angular/cli`, maybe you have to change also the version for `@angular/compiler-cli`, for example. – kedenk Aug 01 '18 at 08:28
-2

If you want to install the latest version of Node on your system either you can upgrate or you can uninstall the current node version then download and install below official node site - https://nodejs.org/en/download/

To check current installed node version use

1. Window key+ r -> opens run window
2. Type cmd press enter.
3. Type node -v to check the currently installed node version.
4. Type npm -v to check currently installed npm version.
5. Your primary problem was to install angular/cli
so  use command npm install -g @angular/cli this will install angular/cli globally.
Prabhat Maurya
  • 1,058
  • 16
  • 21