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 
    
6
  • How are you executing the script? Commented Mar 28, 2022 at 8:18
  • terminal powershell restricted. how can i unrestricted? Commented Mar 28, 2022 at 8:21
  • Set-ExecutionPolicy Commented Mar 28, 2022 at 8:23
  • Did you see about_Execution_Policies for more information? Commented Mar 28, 2022 at 8:40
  • 1
    Does this answer your question? PowerShell says "execution of scripts is disabled on this system." Commented Mar 28, 2022 at 9:26

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.