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.
Seen on:
Windows
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
- 403 Forbidden wp-admin WordPress: 403 Forbidden on wp-admin, wp-login.php or admin-ajax.php
Most viewed in Windows
Other ways to find it
🧠 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026