Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase script not signed - Powershell

I'm setting up a new project with Firebase and after running the command firebase init functions, I get the error below.

firebase : File C:\Users\fudge\AppData\Roaming\npm\firebase.ps1 cannot be loaded. The file C:\Users\fudge\AppData\Roaming\npm\firebase.ps1 is not digitally signed. 
You cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies at 
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ firebase init functions
+ ~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

I know that I can run

Set-ExecutionPolicy -ExecutionPolicy Unrestricted

to allow it to run, but that seems dangerous as I imagine I would also allow malicious scripts to run if my PC ever got any. Is there any reason why the Firebase package isn't digitally signed and is there anyway to use firebase without changing the Execution Policy?

Before the init command I only used these three commands, using Node v12.14.0:

npm init
npm install firebase-functions@latest firebase-admin@latest --save
npm install -g firebase-tools
like image 873
S.Ramjit Avatar asked Jun 13 '26 00:06

S.Ramjit


1 Answers

I was getting the same error in the VSCode terminal, so I ran the command into the command prompt and it worked for me.

like image 173
Cherry Blossom Girl Avatar answered Jun 14 '26 14:06

Cherry Blossom Girl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!