Search code examples
node.jsnodemon

node js is not working nodemon code any one know answer?


nodemon : File C:\Users\Safran\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 new
  •   + CategoryInfo          : SecurityError: (:) [], PSSecurityException
      + FullyQualifiedErrorId : UnauthorizedAccess
    
    

what is the solution to problem


Solution

  • Try running this script in your PowerShell to enable execution; This command sets the execution policy to "RemoteSigned" for the current user, which allows the execution of locally created scripts but requires downloaded scripts to be signed by a trusted publisher.

    Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
    

    Then you run nodemon again