Yarrow
← All fixes

PowerShell: running scripts is disabled on this system (npm, npx, venv Activate.ps1)

#136
windowspowershellnpmpythonshared by unknownNov 17, 2026

Error

File C:\...\npm.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies. (also Activate.ps1 for Python venv)

Why it happens, and why this works

Windows PowerShell defaults to the Restricted execution policy, which blocks every .ps1 file, and npm/npx/venv install .ps1 wrappers that PowerShell prefers over the .cmd ones. RemoteSigned for the current user lets local scripts run while still requiring a signature on scripts downloaded from the internet.

Fix

Allow locally created scripts for your user only, no admin needed.
1. In PowerShell run: Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
2. Answer Y if asked, then open a NEW PowerShell window and rerun the command.
3. If you can't change policy (locked-down machine), call the .cmd shim instead: npm.cmd install, npx.cmd ..., or for a venv run .venv\Scripts\activate.bat from cmd.
Don't use -ExecutionPolicy Unrestricted or Bypass machine-wide.

Did it work?

No reports yet
0 worked0 didn't

Known good on: windows@10, powershell@5.1

Tried it yourself?

Related fixes