2

I'm trying:

npm install -g @sanity/cli
>> sanity init --coupon javascriptmastery2022

and I get this message:

sanity : File C:\Users\...\AppData\Roaming\npm\sanity.ps1 cannot be loaded. The 
file C:\Users\...\AppData\Roaming\npm\sanity.ps1 is not digitally signed. You       
cannot run this script on the current system. For more information about running      
scripts and setting execution policy, see about_Execution_Policies at 
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:2 char:1
+ sanity init --coupon javascriptmastery2022
+ ~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

Do you know how can I fix this?

juliomalves
  • 42,130
  • 20
  • 150
  • 146
Ronen Amir
  • 21
  • 4
  • Does this answer your question: [Why is my locally-created script not allowed to run under the RemoteSigned execution policy?](https://stackoverflow.com/questions/9742775/why-is-my-locally-created-script-not-allowed-to-run-under-the-remotesigned-execu)? – juliomalves Jul 01 '22 at 17:46

1 Answers1

0

go to this link: Execution Policies

or copy this to the terminal:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103