Program ng failed to run No application is associated with the specified file

Issue Description

Ng commands on Visual Studio code gives below error,

Program 'ng' failed to run No application is associated with the specified file for this operation line

Program ng failed to run No application is associated

Resolution

I had this issue recently upgrading to the Angular CLI framework.

Ng Commands were working fine in other CLI as PowerShell and commands prompt but was failing on the VSCode PowerShell.

Steps to resolve the issue

To change the PowerShell execution policy on your Windows computer, use the below command

Step1: Get-ExecutionPolicy for your Machine using the below command

 Get-ExecutionPolicy -List
Program ng failed to run No application is associated

Step2: please run the below commands

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Program ng failed to run No application is associated

Please close the VSCode PowerShell and restart it. Finally, you shall be all set to run your script. If any issue persists, just restart your machine.

If you still get any errors, please make sure to close all existing commands prompt / PS windows.

If the issue still persists please make sure you have set the Environment variable properly as explained here. You can also try re-installing Angular cli.

Additional references:

That’s all! Happy coding!

Does this help you fix your issue?

Do you have any better solutions or suggestions? Please sound off your comments below.



Please bookmark this page and share it with your friends. Please Subscribe to the blog to receive notifications on freshly published(2024) best practices and guidelines for software design and development.



6 thoughts on “Program ng failed to run No application is associated

Leave a Reply

Your email address will not be published. Required fields are marked *