Twitter Facebook Google+ LinkedIn Pinterest Tumblr Reddit
Question

I try to run nodemon library but it gives me an error how to fix?

Tags: node.js npm nodemon
Date:
Status:Resolved
Question Id:11

nodemon : File C:\Users\Eva\AppData\Roaming\npm\nodemon.ps1 cannot be loaded because running scripts is disabled on this syste
m. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ nodemon app
+ ~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

Answer
Date:
Correct:Yes

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

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

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

You'll get the output 'Unrestricted'

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

Your Answer

Review Your Answer