Installed angular-cli globally using (npm install -g angular-cli
) but when I\'m trying to create project using ng new my-project
it is throwing err
Repairing NodeJS installation on windows resolved it for me.
if you find this error when you are installing angular-cli,
-bash: ng: command not found
try this it works,
After removing Node from your system
install NVM from here https://github.com/creationix/nvm
Install Node via NVM: nvm install stable
run npm install -g angular-cli
Run below commands:
npm uninstall -g angular-cli
npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli@latest
alias ng="C:/Users/itaas/.npm-global/ng"
( Location of ng file in npm folder)
And finally run :
ng -v
If you are working in windows 7 and you can not run command start with ng
please, update the angular/CLI at once and try to use ng commands
use below comman to update latest CLI
npm install -g @angular/cli@latest
soluton for windows operating system only....... first step:
install nodejs version: nodev 8.1.2
second step: set up environment variable like: C:\ProgramFiles\nodejs
Third step: install angular use this command: npm install -g @angular/cli
after installation whereever you have to create project like: ng new first-project......
Make sure that the npm directory is in your "Path" variable.
If the module is installed properly, it may work if you start it out of your global node module directory, but your command line tool doesn't know where to find the ng
command when you are not in this directory.
For Win system variable add something like:
%USERPROFILE%\AppData\Roaming\npm
And if you use a unix-like terminal (emulator):
PATH=$PATH:[path_to_your_user_profile]/path-to-npm