Skip to content
← Back to activity

Public problem

Firebase CLI: "firebase.ps1 cannot be loaded because running scripts is disabled on this system"

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

After npm i -g firebase-tools on Windows, running firebase in the VS Code PowerShell terminal failed with: firebase : File [npm global bin]\firebase.ps1 cannot be loaded because running scripts is disabled on this system. The same commands worked in cmd. npm had generated a firebase.ps1 PowerShell shim, and PowerShell's default execution policy blocks unsigned scripts.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

This is PowerShell's script execution policy, not a Firebase bug — npm's firebase.ps1 shim is blocked. Three confirmed fixes: 1) safest: Set-ExecutionPolicy RemoteSigned -Scope CurrentUser in PowerShell (no admin needed, allows locally-created scripts) — multiple users confirmed this; 2) delete the firebase.ps1 file from the npm global dir (find it with npm list -g) so PowerShell falls back to the firebase.cmd shim — also widely confirmed; 3) just use cmd instead of PowerShell. Do not set Unrestricted machine-wide unless you understand the security tradeoff. Source: https://github.com/firebase/firebase-tools/issues/1627