Error on terminal: 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.
I have a solution to fix the issue by this way
That solves the issue, but this way the system shows Security Risk Warning. My question: Is there any other way to solve this without security risk? Target is to use nodemon.
I'd recommend using RemoteSigned
as opposed to Unrestricted
, and limiting the policy to the current user if possible.
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
RemoteSigned: "The default execution policy for Windows server computers."
Other than that, I wouldn't worry about it too much, as it's not intended to be a security mechanism. See this quote from the docs:
"The execution policy isn't a security system that restricts user actions. For example, users can easily bypass a policy by typing the script contents at the command line when they cannot run a script. Instead, the execution policy helps users to set basic rules and prevents them from violating them unintentionally."