0

How can solve this?

C:\Users\User\AppData\Roaming\npm\sanity.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

  • sanity init --coupon cleverprogrammer
  •   + CategoryInfo          : SecurityError: (:) [],   
    PSSecurityException
      + FullyQualifiedErrorId : UnauthorizedAccess 
    
Pema Dorji
  • 11
  • 1
  • 1
  • 4
  • How are you executing the script? – Cid Mar 28 '22 at 08:18
  • terminal powershell restricted. how can i unrestricted? – Pema Dorji Mar 28 '22 at 08:21
  • [`Set-ExecutionPolicy`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy?view=powershell-7.2) – Cid Mar 28 '22 at 08:23
  • Did you see `about_Execution_Policies` for more information? – Lance U. Matthews Mar 28 '22 at 08:40
  • 1
    Does this answer your question? [PowerShell says "execution of scripts is disabled on this system."](https://stackoverflow.com/questions/4037939/powershell-says-execution-of-scripts-is-disabled-on-this-system) – Lance U. Matthews Mar 28 '22 at 09:26
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Mar 30 '22 at 17:46

1 Answers1

1

Check for Get-ExecutionPolicy if it is like "AllSigned, Bypass, Default, Restricted, Undefined" then execute the below command in PowerShell Administrator mode. You can also use RemoteSigned, Unrestricted

Set-ExecutionPolicy -ExecutionPolicy Unrestricted

Narayana Lvsl
  • 315
  • 2
  • 10