0

I tried to use npx thirdweb@latest create --contract but I got this error:

[ npx : File C:\Users\AppData\Roaming\npm\npx.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

  • npx thirdweb@latest create --contract
  •   + CategoryInfo          : SecurityError: (:) [], PSSecurityException
      + FullyQualifiedErrorId : UnauthorizedAccess]
    
    

To fix it, I tried this solution, and it worked for me.

The error message indicates that running scripts is currently disabled on your system, which is preventing the execution of the npx command. This is a security feature in PowerShell called "Execution Policy." To fix this error, you have a few options:

Option 1: Temporarily change the Execution Policy

  1. Open a PowerShell window as an administrator. To do this, right-click on the PowerShell icon and select "Run as administrator."

  2. In the elevated PowerShell window, run the following command:

    Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted

0 Answers0