0

I am learning nodejs and came across nodemon. I installed nodemon using this command npm install -g nodemon and it installed successfully but when i try to run nodemon using command nodemon then it through this error in command prompt.

nodemon : File C:\Users\callm\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 index.js
+ ~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess
  • 1
    see https://stackoverflow.com/questions/4037939/powershell-says-execution-of-scripts-is-disabled-on-this-system – giulp Jul 28 '21 at 08:40

1 Answers1

0

Using RemoteSigned as opposed to Unrestricted, and limiting the policy to the CurrentUser if possible.

Run Powershell as Admin, and then:

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Muhammad Yasin
  • 418
  • 4
  • 11