0

Unable to run npm scripts on windows powershell

enter image description here

dhilmathy
  • 2,800
  • 2
  • 21
  • 29
  • 2
    The error message tells you everything you need to know: [follow the guidance in the `about_Execution_Policies` help file](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies) – Mathias R. Jessen Feb 01 '22 at 18:00

1 Answers1

1

Run powershell as an admin and then

Set-ExecutionPolicy Unrestricted

rerun
  • 25,014
  • 6
  • 48
  • 78
  • While this works, I suggest mentioning the security implications of choosing such a lax policy. `RemoteSigned` is the safer choice. Also worth mentioning that there's no strict need for elevation (running as admin), which isn't always an option - execution policies can also be set on a per-user basis, with `-Scope CurrentUser` – mklement0 Feb 01 '22 at 21:08