5

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.

3 Answers 3

20

I think the last version compatible with node 6.9.x is @angular/[email protected] Check this for all versions

npm uninstall -g @angular/cli
npm cache clean --force
npm install -g @angular/[email protected]
Sign up to request clarification or add additional context in comments.

7 Comments

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.
So..Which solution is better to resolve this issue..Please tell me..I can not do anything without angular cli here
@kedenk Question is about installing @angular/cli, not about a version in a project
TimMartens: Any solution is there?
@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/[email protected]. Also, add --force to npm cache clean
|
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.

2 Comments

kedenk:So i want to change only "@angular/cli":"~1.7.0" rite? then nmp install?
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.
-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.

2 Comments

Prabhat: Read my question..I can not update my nodejs version i do not have admin rights. I have installed Node v6.9.5.
@Tim Martens I have mentioned either upgrade or uninstall the node.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.