DEV Community 👩‍💻👨‍💻

DEV Community 👩‍💻👨‍💻 is a community of 967,911 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Jumbo Daniel
Jumbo Daniel

Posted on

How to Fix Nodemon (nodemon.ps1) Cannot Be Loaded Because Running Scripts is Disabled on This System.

This is a simple solution for solving this error on windows

>nodemon : File C:\Users\hp\AppData\Roaming\npm\nodemon.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see 
about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ nodemon app
+ ~~~~~~~

Enter fullscreen mode Exit fullscreen mode

First Step
First search and run PowerShell as administrator

Second Step
If you read through the error message you will see this error was generated from Execution_Policies. In you powershell window type and enter the get execution policiy command.

Get-ExecutionPolicy

Enter fullscreen mode Exit fullscreen mode

Final Step
After running the command it will return restricted as the result. We have to set the execution policy to unrestricted using the Set-ExecutionPolicy command.

Set-ExecutionPolicy Unrestricted

Enter fullscreen mode Exit fullscreen mode

After this you will get a prompt message. Press Y to change it.
To be sure you have changed the get execution policy you can simply run it again to check the result. You'll get the output 'Unrestricted'

Now you can use nodemon on your machine.

Top comments (4)

Collapse
 
themihir profile image
Mihir Das

Thanks For the soluation.

Collapse
 
jumbo02 profile image
Jumbo Daniel Author

You are welcome

Collapse
 
scottlexium profile image
Scottlexium

What caused the issue in the first place? I dont seem to recognise this.

Collapse
 
elghaied profile image
elghaied

thanks a lot

🌚 Friends don't let friends browse without dark mode.

Sorry, it's true.