-3
PS C:\Users\Leff Tubat\express-demo> nodemon index.js
nodemon : File C:\Users\Leff Tubat\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

I tried ./index.js 3000 but it did not work out.

halfer
  • 19,824
  • 17
  • 99
  • 186
Leff Tubat
  • 11
  • 2
  • You need to be admin, to change the policy, by default you cannot run untrusted scripts in powershell – Lk77 Mar 10 '23 at 09:23
  • Read the error message, go to https:/go.microsoft.com/fwlink/?LinkID=135170 and read that page. – jabaa Mar 10 '23 at 09:37
  • Hii, I just resolved the problem, thanks for y'all help! It really means a lot. I even executed the Set-ExecutionPolicy Unrestricted syntax to allow me to run the script. – Leff Tubat Mar 10 '23 at 10:15

1 Answers1

0

Open the powershell as administrator and run the following command

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser