Why does sanity cli get error while install it?

Viewed 90

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?

1 Answers

go to this link: Execution Policies

or copy this to the terminal:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Related