nodemon.ps1 cannot be loaded because running scripts is disabled on this system – How to fix?

nodemon.ps1 cannot be loaded because running scripts is disabled on this system – How to fix?

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.

Get-ExecutionPolicy

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.

Set-ExecutionPolicy 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.

Get-ExecutionPolicy

If your Execution Policy has changed successfully then you will get the output as Unrestricted after executing the above command.

Conclusion

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.

Sharing is caring

Did you like what Mehul Mohan wrote? Thank them for their work by sharing it on social media.

0/10000

No comments so far