繁体   English   中英

使用“firebase init”安装 Firebase 功能模拟器后如何卸载它

[英]How to uninstall Firebase functions emulator after installing it with "firebase init"

我使用firebase init > emulators在我的项目中安装了 Firebase Functions 和 Firestore 仿真器,但现在意识到我不再需要 Functions 仿真器,所以我试图删除它。

如何卸载模拟器,以便firebase emulators:start命令默认不尝试启动它?

我尝试了以下但firebase init > emulators继续显示功能模拟器仍然启用(绿点)和firebase emulators:start如果我不包括--only firestore标志,默认情况下继续启动功能模拟器。

  • 我重新运行firebase init > emulators and deselected functions
    • 这没有做任何事情
  • 我从firebase.json手动删除了该条目
    "emulators": { "functions": { // <-- I removed this block "port": 5001 }, "firestore": { "port": 8080 }, "ui": { "enabled": true } }
  • 我从~/.cache/firebase/emulators清除了模拟器缓存
  • 我从firebase.json中删除了functions块,只是为了看看是否触发了它。
     { "functions": { // <-- I removed this block "predeploy": [ "npm --prefix \"$RESOURCE_DIR\" run clean", "npm --prefix \"$RESOURCE_DIR\" run lint", "npm --prefix \"$RESOURCE_DIR\" run build" ], "source": "functions" }, "firestore": { "rules": "firestore.rules", "indexes": "firestore.indexes.json" }, "emulators": { "firestore": { "port": 8080 }, "ui": { "enabled": true } } }

完成上述所有操作后, firebase emulators:start仍然尝试启动函数 我想知道这是否可能是因为 firestore 模拟器依赖于函数模拟器但如果是这种情况我不知道为什么它会让我单独运行 firestore 模拟器--only firestore

如果您不想在项目中使用 Cloud Functions,您也应该从项目目录中删除“functions”文件夹。

另外,建议您在firebase-tools GitHub上为此提交错误。 在 firebase.json 中,功能仿真器无需配置即可运行的事实感觉像是一个错误,而且它以前不是这样工作的。

就我而言,我从 node_modules 中删除了 Function 目录,并从 firebase.json 中删除了功能块。

我修复它只是运行 npm 再次安装 firebase 。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM