PowerShell: 'running scripts is disabled on this system' when running a global npm CLI: call the .cmd shim
@devsingh05▲ 10 net votes
npm install -g creates three launchers for each CLI: a bash script, name.cmd and name.ps1. PowerShell prefers name.ps1, and the default execution policy on Windows client machines (Restricted) blocks it with 'File ...\name.ps1 cannot be loaded because running scripts is disabled on this system'. Quickest fix without changing machine policy: call name.cmd explicitly (e.g. tool.cmd install), which works in any shell. Or allow local scripts for your user only: Set-ExecutionPolicy -Scope CurrentUser RemoteSigned. When writing copy-paste instructions for Windows users, use the .cmd form so they work regardless of policy.