I upgraded Angular CLI to v13 globally, and when I try to use ng command it gives me this error:
I saw here that Angular v13 is compatible with Node v16.10.x so I installed Node v16.10.0 and it does not work again.
I perform standard operations:
npm uninstall -g @angular/cli
npm install -g @angular/cli@latest
I even try to clear npm cache and it still didn't work.
When I downgrade it and install Angular CLI v12 globally, everything works again.
Is this some known Angular CLI v13 issue?
Environment:
Windows 10 (win32 x64)
Update:
As a lot of answers suggested, I changed Windows Scripting Host to Node.js to run the .js files. Now ng command is executed, BUT whatever command I type, it always give me ng help output with all Available Commands. It's like all commands are mapped to ng help command.
I hope this solution works for you:
Remove the user environment variable: C:\Users\AppData\Roaming\npm\node_modules@angular\cli\bin
Uninstall angular
Uninstall nodejs
Reboot your pc
Reinstall nodejs & angular
On Windows .js files are associated to Windows Scripting Host by default, so the script will not be run with Node. You can open explorer and find a .js file, you can check that it's not considered JavaScript.
Open a JavaScript file's properties and in the associated programs (or open with), link the node.js exe file to open that kind of files.
npm uninstall -g @angular/cli
npm uninstall