I am trying to create Angular2 project using angular-cli. I run, npm install -g angular-cli then I ng new test, it returns

"'ng' is not recognized as an interal or external command, operable program or batch file."

I check the directory, C:\node\node_modules\npm\node_modules. There was not angular-cli found. My npm version is 4.0.2 and my node version is 5.11.0. If you guys have same problem, could you help me how to figure this out?

share|improve this question

From angular-cli docs

Prerequisites

Both the CLI and generated project have dependencies that require Node 6.9.0 or higher, together with NPM 3 or higher.

You need to upgrade your node and npm first.

share|improve this answer
    
Yep, after this, I made it. – Anna Lee Feb 16 at 17:39

1) As VadimB suggested, you need to upgrade node and npm versions. Install latest version of node from nodejs.org and make sure you choose minimum Node 6.9.0 setup.

2) You are trying to run wrong command. Current version command is - npm install -g @angular/cli (Please note - @ before angular/cli package in above command.)

3) After @angular/cli installation, you can use ng help or ng -v to check successful installation and version.

4) You are looking at wrong folder. Once installed successfully, @angular\cli will be available in C:\Users\<UserName>\AppData\Roaming\npm\node_modules\

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.