将Node模块的本地修改部署到Firebase的Cloud Functions [英] Deploy a local modification of Node module to Cloud Functions for Firebase

查看:46
本文介绍了将Node模块的本地修改部署到Firebase的Cloud Functions的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Firebase开发一些Cloud Functions,尤其是其中一个对我的功能所依赖的节点模块之一没有问题.

I am developing some Cloud Functions for Firebase, and one in particular does not work to an issue in one of the node modules on which my function depend.

我已经找到问题所在和解决方法,问题是,如果我修改node_modules/文件夹中的源,则该更新不会发送到服务器.我从package.json中删除了依赖项,并做了(在本地修改文件之前):

I already found where is the issue and how to fix it, the problem is that, if I modify the source in node_modules/ folder, that update is not sent to the server. I removed from the package.json the dependency and did (before modify the file locally):

npm install --save pdf2img

但是该函数未更新,错误始终相同.有可能做我愿意做的事吗?

But the function is not updated, the error is always the same. Is it possible to do what I would or not?

感谢任何提供帮助的人!

Thanks for anyone providing help!

推荐答案

感谢Mr.Phoenix的提示,解决方法是:

Thanks to Mr.Phoenix hint, the solution is:

  • 分叉存储库(或者在我的情况下,找到已经有此修复程序的分叉).

  • Fork the repository (or in my case, find a fork that already has the fix).

使用以下命令删除以前的版本:

remove the previous version with:

npm未安装-保存pdf2img

npm uninstal --save pdf2img

  • 使用以下命令从分支中安装新版本:
  • npm install-保存git + https://git@github.com/matteocontrini/node-pdf2img

    这种特定情况下的问题无法解决,因为该库依赖于"gm"以及firebase函数中不可用的其他库

    The problem in this specific case cannot be solved because the library relies on "gm" and other libraries that are not available in firebase functions

    这篇关于将Node模块的本地修改部署到Firebase的Cloud Functions的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆