“Nodemon.ps1 cannot be loaded because running scripts is disabled on this system” is a common error related to the unsafe Windows policy. The below explanations can help you know more about the cause of error and solutions.
How does the error “nodemon.ps1 cannot be loaded because running scripts is disabled on this system” happen?
This error happens due to the many following reasons:
First, it might be because running scripts is disabled on this system, as the execution policy has banned running the given script in Windows. To check this, run Powershell as administrator and run:
get-ExecutionPolicy
Output:
Restricted
Second, it’s safe if you allow running remotely signed scripts on the computer. This means you can run unsigned local scripts, i.e. scripts you wrote…. Otherwise, scripts run from nodemon (remote source) must have been signed by trusted authorities. If you’re using Windows, open Settings, then choose “Update & Security”. At the “For developers” menu, scroll down to find this check box in the “PowerShell” subheading:
How to solve the error?
Solution 1: Change the current execution policy
To solve “nodemon.ps1 cannot be loaded because running scripts is disabled on this system” error, you will have to open Powershell as administrator and run this command:
Set-ExecutionPolicy Unrestricted
Or you can use this command to change the current execution policy to RemoteSigned (the default execution policy for Windows server computers) instead of Unrestricted, this will change the policy to the CurrentUser if possible:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Now you can check again to see execution policy changes with this command
Get-ExecutionPolicy
You should get 1 of 2 following outputs:
Unrestricted
RemoteSigned
Solution 2: Change execution policy to allow local Powershell scripts to run without signing
If you’re using Windows 10 or 11, open Settings and choose Update & Security:
Click “For Developers” in the left sidebar and at the PowerShell subheading. Tick option:
Solution 3: Delete the nodemon.ps1 file
Go to this location in you computer:
C:\Users\Your_name\AppData\Roaming\npm
Then delete the file named nodemon.ps1 and restart the terminal. Now run the code again to check if you had succeeded:
nodemon 'code.js'
If you caught the same error, you should try cleaning npm cache and then rerun the above code:
npm cache clean --force
Summary
We have learned how to deal with the error “nodemon.ps1 cannot be loaded because running scripts is disabled on this system” in NodeJS. You can quickly solve this problem by checking the execution policy carefully and finding out the reasons causing this problem in this tutorial.
Maybe you are interested:
- ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
- “geom_path: Each group consists of only one observation. Do you need to adjust the group aesthetic”
- Error: vector memory exhausted (limit reached?)

I’m Edward Anderson. My current job is as a programmer. I’m majoring in information technology and 5 years of programming expertise. Python, C, C++, Javascript, Java, HTML, CSS, and R are my strong suits. Let me know if you have any questions about these programming languages.
Name of the university: HCMUT
Major: CS
Programming Languages: Python, C, C++, Javascript, Java, HTML, CSS, R