Cannot use tool on windows machine due baseCommand 'ng g' cannot run
Artur51 opened this issue · 7 comments
Hi,
I have installed this extension and it does not work on my windows pc. All the command-line shells I have on this pc do not support "ng" execution but supports "npx ng" instead. Could you please introduce a fix for this case?
Thank you!
Hi,
As mentioned in the extension documentation, it is currently required to have Angular CLI installed. The official Angular documentation does to. So this is not an issue, it is working as intended.
Adding support for another base command is already discussed in #430 and #610. But it is not so simple to add. If there is a specific reason why you can't simply do a npm install @angular/cli -g
, please mention it in one of the discussions.
If @angular/cli
is installed globally, direct ng g
commands should work, and it is not related to this extension.
The most frequent cause of this problem is that npm install @angular/cli -g
has been done in a shell different from the one used in VS Code (for example, doing the global install in cmd, then using PowerShell in VS Code). Doing npm install @angular/cli -g
directly in VS Code terminal (instead of an external terminal), and then restarting VS Code, should solve the issue. The troubleshooting guide already explains this.