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
-
created new project with 1 firebase function “hello_word”
-
when I have run “firebase emulators:start --only firestore,functions” al works perfect
-
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”
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 22 (8 by maintainers)
@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 thenpminstall. So if this is essential to you, installfirebase-toolsvianpm install -g firebase-toolsand it should work.The reason this does not work is because we use
pkgto embednodeinside the standalone binary. For security reasons this embeddednodeinstall blocks all Node debugging via the--inspectflag. 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:
That is https://github.com/firebase/firebase-tools/issues/1371