node.js - Firebase 脚本未签名 - Powershell

标签 node.js firebase powershell google-cloud-functions

我正在使用 Firebase 设置一个新项目,然后运行命令 firebase init functions ,我收到以下错误。

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

我知道我可以跑
Set-ExecutionPolicy -ExecutionPolicy Unrestricted

允许它运行,但这似乎很危险,因为我想如果我的 PC 有任何恶意脚本,我也会允许它运行。 Firebase 软件包没有经过数字签名是否有任何理由可以使用 firebase不改变执行政策?

在 init 命令之前我只使用了这三个命令,使用的是 Node v12.14.0:
npm init
npm install firebase-functions@latest firebase-admin@latest --save
npm install -g firebase-tools

最佳答案

我在 VSCode 终端中遇到了同样的错误,所以我将命令运行到命令提示符中,它对我有用。

关于node.js - Firebase 脚本未签名 - Powershell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59505442/

相关文章:

node.js - 控制台输入不正确?

javascript - Node.js 异步并行不工作应该如何?

android - 如何检测 Firebase 监听器是否已完成获取数据?

powershell - 可以通过类似powershell的指标来获取azure vm的cpu使用率

Powershell 选择包含特定字符串的最新文件

node.js - 端口 9200 拒绝连接?

javascript - NodeJS REST API 等待响应

javascript - 如何使用 Firebase SDK v9(模块化)在 Firebase 实时数据库中读取、写入和查询数据

java - Android Firebase 多重排序

powershell - 如何在powershell中解析json响应