Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

201
Visualizações
Deploy a local modification of Node module to Cloud Functions for Firebase

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.

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!

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

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 uninstal --save pdf2img

  • Install the new version from the fork with:

npm install --save git+https://git@github.com/matteocontrini/node-pdf2img

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

over 4 years ago · Santiago Trujillo Relatório

0

  1. Let say you made a change in a dependency called protobufjs in your node_modules.
  2. Copy this package protobufjs from your node_modules to functions folder.
  3. Add to your dependencies the following: "protobufjs": "file:./protobufjs" (assuming you placed the protobufjs folder in the root of functions folder).
  4. Run: firebase deploy.
over 4 years ago · Santiago Trujillo Relatório

0

If you have forked from the original repo to your own GitHub repo, you can clone your version into the root of your "functions" folder. Then:

  1. If the package needs to be compiled into Javascript from Typescript, build the package using either yarn (there will be a yarn.json file) or npm (there will be a package.json file).

  2. Do as the previous answer by Daniel Danielecki suggested and add to your dependencies the following: "[YOUR-PACKAGE-NAME]": "file:./[YOUR-PACKAGE-NAME]"

  3. Try to deploy using "firebase deploy". You might receive an es-lint error similar to - "eslint error - Cannot find module '@[SOME-NAME]/eslint-config'". This is a bug in eslint and can be viewed here eslint bug. To fix this issue, simply add a ".eslintignore" file into the the root of your "functions" folder and add the line "[YOUR-PACKAGE-NAME]/*" to ignore the false linting errors for a successful deploy.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda