firebase-tools: emulator throwing error MODULE_NOT_FOUND with --inspect-functions

[REQUIRED] Environment info

firebase-tools: 8.4.3

Platform: mac os catalina 10.15.5 node -v v12.18.1

visual studio code Version: 1.46.1

[REQUIRED] Test case

  1. created new project with 1 firebase function “hello_word”

  2. when I have run “firebase emulators:start --only firestore,functions” al works perfect

  3. when I run “firebase emulators:start --only firestore,functions --inspect-functions” I’ve got error:


functions: Watching “/Users/username/Documents/Firebase/myproject/purchases/functions” for Cloud Functions…

internal/modules/cjs/loader.js:983 throw err; ^

Error: Cannot find module ‘/Users/username/Documents/Firebase/myproject/purchases/functions/–inspect=localhost:9229’ at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15) at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1346:46) at Function.Module._load (internal/modules/cjs/loader.js:862:27) at Function.Module.runMain (pkg/prelude/bootstrap.js:1375:12) at internal/main/run_main_module.js:18:47 { code: ‘MODULE_NOT_FOUND’, requireStack: [] }


[REQUIRED] Steps to reproduce

run “firebase emulators:start --only firestore,functions --inspect-functions”

firebase-debug-without-inspect.log

firebase-debug-with-inspect.log

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 22 (8 by maintainers)

Most upvoted comments

@abeisgoat investigated this, I’ll summarize what he told me.

It turns out this is only an issue with the standalone Firebase Tools binary (installed via curl) and not an issue with the npm install. So if this is essential to you, install firebase-tools via npm install -g firebase-tools and it should work.

The reason this does not work is because we use pkg to embed node inside the standalone binary. For security reasons this embedded node install blocks all Node debugging via the --inspect flag. We may be able to find a way around this, but it will be a pretty big change so it’s not likely to happen very soon.

@quantuminformation your error message is not related to this issue:

>  Error listing users: FirebaseAuthError: //cloud.google.com/docs/authentication/. Raw server response: "{"error":{"code":403,"message":"Your application has authenticated using end user credentials from the Google Cloud SDK or Google Cloud Shell which are not supported by the identitytoolkit.googleapis.com. We recommend configuring the 

That is https://github.com/firebase/firebase-tools/issues/1371