File cannot be loaded because running scripts is disabled on this system (PowerShell execution policy)
PowerShell’s execution policy blocks .ps1 scripts — including npm/yarn/pnpm shims like npm.ps1.
running scripts is disabled on this systemcannot be loaded because running scripts is disabled Meaning
Windows defaults to Restricted on client machines. Tools installed via npm, Python venv Activate.ps1 and other scripts fail until the policy allows local scripts. Organisations may enforce policy via GPO.
Common causes
- Execution policy Restricted (default on Windows clients)
- Script downloaded from the internet (Zone.Identifier) under RemoteSigned
- GPO enforcing the policy
⚡ Quick fix
- Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
- Unblock downloaded scripts (Unblock-File)
- Use npm.cmd or bypass for one run: powershell -ExecutionPolicy Bypass -File script.ps1
Detailed fix by platform
PowerShell
- powershell
Get-ExecutionPolicy -List Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned Unblock-File .\script.ps1
How to diagnose
- Policy — Get-ExecutionPolicy -List (which scope wins)
- GPO — MachinePolicy/UserPolicy set?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- 0x800704EC 0x800704EC: This program is blocked by group policy (Windows Defender)
- 1005 Cloudflare Error 1005: Access denied — The owner of this website has banned the autonomous system number (ASN) your IP address is in
- 15281 SQL Server Msg 15281: SQL Server blocked access to procedure 'sys.xp_cmdshell' (component 'xp_cmdshell' turned off)
Most viewed in Windows
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 13 Oct 2026