Unlocking Angular CLI: Resolving Windows Script Host Error 800A03F6

If you find yourself encountering a perplexing Windows Script Host Error: Invalid character with code 800A03F6 while trying to execute Angular CLI commands in your command prompt, fear not! There's a solution at hand.


Here's a step-by-step guide on how to resolve this pesky issue:


Step 1: Open PowerShell in Admin mode. To do this, simply search for "PowerShell" in your Windows search bar, right-click on it, and select "Run as administrator."


Step 2: In the elevated PowerShell window, enter the following command:


Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser


This command sets the execution policy to RemoteSigned for the current user, which allows locally created scripts to run without a digital signature.


Step 3: Now, let's delve into some directory tweaking. Navigate to the directory `C:\Users\%username%\AppData\Roaming\npm\` in File Explorer. Once there, locate and remove the file named `ng.ps1`.


Step 4: Still within the `C:\Users\%username%\AppData\Roaming\npm\` directory, proceed to clear the npm cache. You can do this by navigating to `C:\Users\%username%\AppData\Roaming\npm-cache\` and deleting its contents.


Step 5: Next, venture into the `C:\Users\%username%\AppData\Roaming\npm\node_modules\@angular\cli\bin` directory. Here, you'll want to locate a file named `ng.js`.


Step 6: Right-click on the `ng.js` file and select "Properties" from the dropdown menu.


Step 7: Within the Properties window, navigate to the "Open with" section and click on the "Change" button.


Step 8: In the subsequent dialog, you'll want to locate your Node.js installation directory. Typically, this would be something like `C:\Program Files\nodejs\`. Once you've found it, select the `node.exe` executable.


Step 9: Click "OK" to confirm your selection. You should notice a change in the color of the `ng.js` file, indicating that it is now associated with `node.exe`.


And there you have it! By following these steps, you should have successfully resolved the Windows Script Host Error: Invalid character with code 800A03F6 quandary. Now you can resume your Angular CLI adventures without any pesky interruptions. Happy coding!

Angular  || Why Powershell does not run Angular commands ? || 800A03F6