Most of the people might have faced this error while running nodemon on their Windows local machine. If you are also facing the same problem and searching to get a solution for this problem then this might be the best place to get a solution.
We have divided the solution to this problem into three steps, so don’t forget to follow all the steps to solve this error.
Step 1: Open PowerShell
Go to the start menu and search for “Windows PowerShell” after that right click on it and select the “Run as Administrator” option from the dropdown.
Step 2: Check present execution policy
By looking at the error, you can see that this error is about_Execution_Policies, so you need to see what is present in the execution policy. You can use the following command to get the present execution policy.
After executing the above command, you will see the output as ‘Restricted.’ Due to this reason, you cannot run scripts on this system as running scripts on this system is ‘Restricted.’
Step 3: Change the policy
In this step, we need to change the policy to allow the operation. For doing so we need to execute this command to make it Unrestricted.
After executing this command, you will get a prompt message. From your keyboard, press Y to change it.
To confirm whether the execution policy has changed or not, you need to execute the command given below.
If your Execution Policy has changed successfully then you will get the output as Unrestricted after executing the above command.
If you have followed this article thoroughly, then your problem must have been solved, and you are ready to use nodemon on your machine without any errors.
Thank you for reading this article until this point. If you have any suggestions for updating this article, then you can reach out to me on Twitter, and if I find the suggestions suitable for this article, then I can update it accordingly and also give you credits for the same.