question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error parsing triggers: Cannot find module './db.json'

See original GitHub issue

I’m trying to add image-sharp so i can automatically generate thumbnails. I’ve ran npm install at the functions level and added the following modules:

const functions = require("firebase-functions");
const gcs = require("@google-cloud/storage")();
const path = require("path");
const sharp = require("sharp");
const _ = require("lodash");
const os = require("os");

When I run firebase deploy I get this message at functions: preparing functions directory for uploading...

Error: Error parsing triggers: Cannot find module './db.json'
Try running "npm install" in your functions directory before deploying.

If i remove those new module dependencies from my index.js i don’t get the error.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
joemanfoocommented, Aug 10, 2017

@inlined - I think you’re code and dependencies are fine, it was dependency on my end (sharp@0.17.1) that wouldn’t install on GCF, once I upped my version of Sharp all was well.

0reactions
inlinedcommented, Aug 10, 2017

Glad to hear you’re sorted out. We’ll look at updating the dependencies in the sample.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error parsing triggers Cannot find module when deploying ...
I am implementing a firebase function endpoint that requires I authenticate with two different projects. Information found on SO and other ...
Read more >
Error parsing triggers: Cannot find module 'firebase-functions'
I got the idea from @laurenzlong to remove "functions" key but instead removed "firebase-functions" from package.json and "yarn build && ...
Read more >
Error parsing triggers: Cannot find module 'firebase-admin'
I get the same error message when I do this in the project root directory and in the functions directory.
Read more >
Error parsing triggers: Cannot find module 'firebase-functions'
Coding example for the question Error: Error parsing triggers: Cannot find module 'firebase-functions'-node.js.
Read more >
react-most-wanted/Lobby - Gitter
Error: Error parsing triggers: Cannot find module 'firebase-function-tools' Require stack: - c:\workspace\2020\most-wanted\functions\index.js ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found