Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

200
Views
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 answers
Answer question

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 Report

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!