DEV Community

Cover image for How to fix error- nodemon.ps1 cannot be loaded because running scripts is disabled on this system
Era Codex
Era Codex

Posted on • Edited on

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

A solution for running nodemon on local machine error on Windows :

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.
Enter fullscreen mode Exit fullscreen mode

So if you ever get this error, simply you can follow these steps to solve the issue-

Step 1:

Open Windows PowerShell with Run As Administrator.

Step 2:

As you see the error is about_Execution_Policies, first to see what's there in the present execution policy. Use this command on Windows PowerShell to get it

Get-ExecutionPolicy
Enter fullscreen mode Exit fullscreen mode

Here you'll see 'Restricted'. So, this is the main reason- running scripts on this system is 'Restricted'.

Step 3:

Now we need to change this policy to allow the operation. Use this command to make it Unrestricted -

Set-ExecutionPolicy Unrestricted
Enter fullscreen mode Exit fullscreen mode

Here you'll get a prompt message. Press Y to change it

That's it. To ensure, you may check the execution policy status by this command again

Get-ExecutionPolicy
Enter fullscreen mode Exit fullscreen mode

You'll get the output 'Unrestricted'

The problem is solved. Now you can use nodemon on your machine.

Top comments (44)

Collapse
 
manutdmohit profile image
Mohit Saud

"Doesn't work"
PS C:\Windows\system32> Get-ExecutionPolicy
Restricted
PS C:\Windows\system32> Get-ExecutionPolicy Unrestricted
Get-ExecutionPolicy : Cannot bind parameter 'Scope'. Cannot convert value "Unrestricted" to type
"Microsoft.PowerShell.ExecutionPolicyScope". Error: "Unable to match the identifier name Unrestricted to a valid
enumerator name. Specify one of the following enumerator names and try again:
Process, CurrentUser, LocalMachine, UserPolicy, MachinePolicy"
At line:1 char:21

  • Get-ExecutionPolicy Unrestricted
  • ~~~~~~~~~~~~
    • CategoryInfo : InvalidArgument: (:) [Get-ExecutionPolicy], ParameterBindingException
    • FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.GetExecutionPolicyCommand
Collapse
 
salemaljebaly profile image
Salem Aljebaly

use Set-ExecutionPolicy Unrestricted
not Get-ExecutionPolicy Unrestricted

Collapse
 
rishichoudhary profile image
Rishi-choudhary

There is set-execution policy

Collapse
 
lcarlin profile image
Luiz Antonio Carlin

I´m getting the error bellow when I try to change the policies

Set-ExecutionPolicy Process Unrestricted
Set-ExecutionPolicy: Cannot bind parameter 'Scope'. Cannot convert value "Unrestricted" to type "Microsoft.PowerShell.ExecutionPolicyScope". Error: "Unable to match the identifier name Unrestricted to a valid enumerator name. Specify one of the following enumerator names and try again:
Process, CurrentUser, LocalMachine, UserPolicy, MachinePolicy"

Please, what I´m doing wrong ? can You help-me ?
I'm running PowerShell with administrative rights

Collapse
 
immam profile image
Immam

Thanks very much for your smart help where I was continuously watching the youtube video but failed.This article is just spot on.Thanks again

Collapse
 
eracodex profile image
Era Codex

Glad to know that it helps you. You're welcome!

Collapse
 
immam profile image
Immam

Hi , can you please make an cross platform app that consists with calendar and messaging service to the google review page .
Please get back to me as soon as you can .

Collapse
 
davidhero profile image
Davidhero

Thank you for this sir, this was helpful.

Collapse
 
masud309060 profile image
Md Masud Rana

its really great .. thanks a lot brother.

Collapse
 
eracodex profile image
Era Codex

Welcome brother! Best wishes.

Collapse
 
devanil1806 profile image
Anil Kumar Pradhan

thnx man..it works

Collapse
 
munnasorder profile image
Arifur Rahman Munna

Many thanks my nodemon is working now

Collapse
 
joyshaheb profile image
Joy Shaheb

thank you for this helpful article

Collapse
 
adiel98 profile image
Adiel

Thanks !!!

Collapse
 
ramesh123lang profile image
RAMESH MARANDI

Thanks, Sir, this article helps me a lot.

Collapse
 
junioredris profile image
Imthiaz Ragib

Just loved the solution