- Published on
Running scripts is disabled in VS Code (Windows)
The error
yarn : File C:\Program Files\nodejs\yarn.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.
The fix
Open PowerShell as Administrator and input this: Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
Another solution is to set the command prompt as your default terminal in your IDE.
In VS Code:
Open the terminal, click the downward arrow near the + sign and click Select Default Profile from the menu that pops up.