Search code examples
google-cloud-firestorefirebase-tools

Firebase emulators:exec --only firestore not executing the script given as parameter


I used to run the following command to run some tests against a emulated firestore instance:

firebase emulators:exec --only firestore 'npm test'

Since my upgrade to "firebase-functions": "^3.18.0" and `"firebase-functions-test": "^0.3.3"' this doesn't execute my tests anymore. And after a minute gives me: Error: TIMEOUT: Port 8080 on localhost was not active within 60000ms

Running firebase emulators:start --only firestore works fine. And if I change the command above to firebase emulators:exec --only auth 'npm test' the execution works as expected, but obviously the tests fail.

Does anyone have an idea on how to solve this?


Solution

  • As Gourav B asked me what node version I was on. I figured I would try to run it with different versions I had installed.

    Version 17 was the default one, and would still not work. I quickly changed to 14 and the firebase emulators:exec --only firestore 'npm test' would run smoothly.

    Also node version 16 doesn't have any problems.

    As a tip to people reading this: To quickly switch between node versions I personally use Node Version Manager (nvm)