I am facing the issue ,
Error: You need to specify a command before moving on. Use '--help' to view the available commands
everytime while using any of the ng command
I am facing the issue ,
Error: You need to specify a command before moving on. Use '--help' to view the available commands
everytime while using any of the ng command
Uninstall Angular old version & Install latest version (14)
npm uninstall -g @angular/cli
npm install -g @angular/cli
Use:
ng version | ng v
Instead of:
ng -v | ng --version
I actually upgraded ng version just a day ago. I faced same problem. This happened because the current version in your system got depreciated ( no longer in use). So you have to update ng version in your system.
npm uninstall -g @angular/cli
npm install -g @angular/cli
this will help to update your angular version in your system and to check, you have to give ng version instead ng --version.
I hope this is helpful.
I was also facing the same issue while running the ng --version. I tried to uninstall and reinstall but it didn't work. With cli 14, ng --version doesn't work.
So use ng version instead.
I also got the same error. Try to use
ng version
instead of using the ng --version.
Because hyphen throws an error with the different node version.
ng --version
Error: You need to specify a command before moving on. Use '--help' to view the available commands.
node --version v16.16.0 (new version)
ng v
You just need to specify the command. Try to put 'ng version', but before that, you should make sure that you have Angular CLI
Usually, the default terminal is Command Prompt.
Change that to Power Shell and try it again. For some reason, Command Prompt can not execute Angular CLI commands, at least in my end.
In you are using VS Code, you can check here how to change default terminal.
Uninstall using "npm uninstall -g @angular/cli" and then re-install using "npm install -g @angular/cli" and then try again
Uninstalling and Installing @angular/cli did not work for me this answer fixed it
make sure you have proper path variable configured as shown below Go to your system variable settings path variable snapshot make sure you have all these mentioned as part of path C:\Users\AppData\Roaming\npm\node_modules@angular\cli C:\Users\AppData\Roaming\npm C:\Program Files\nodejs
https://stackoverflow.com/a/71602204/6314006
Make sure to edit the path under System variables.
It is showing error beacuse you are run your command in command prompt and ng --version is used to run on git bash, so either you have to use git bash to run ng --vesrion command or you need to just write ng v on command prompt.
Was facing the same issue while checking the version of Angular cli.
Use ng version to check the version in command prompt
For me I discovered it was a Shell incompatibility. The only one that recognize ng commands is PowerShell.
These below show the same error:
Hopefully this will be fixed in the future.