Невозможно соединиться с пакетом эмуляторов Firebase с помощью exec - PullRequest
0 голосов
/ 02 апреля 2020

Запущен эмулятор проекта Firebase (который использует облачные функции и хранилище) с командой ниже

firebase emulators:start

Он работает успешно и дает мне путь для подключения к функциям, а также показывает локальный URL-адрес хоста для firestore.

Затем, чтобы выполнить мои шутливые тесты, запустили следующую команду

firebase emulators:exec --only firestore jest

В соответствии с документацией, для подключения к локальному первому хранилищу нам нужно использовать exe c. Но выдает ошибку ниже.

i  emulators: Starting emulators: firestore
⚠  emulators: emulator hub unable to start on port 4400, starting on 4401
✔  hub: emulator hub started at http://localhost:4401
i  Shutting down emulators.
i  Stoppping emulator hub
⚠  Port 8080 is not open on localhost, could not start firestore emulator.
i  To select a different host/port for the emulator, update your "firebase.json":
    {
      // ...
      "emulators": {
        "firestore": {
          "host": "HOST",
          "port": "PORT"
        }
      }
    }
i  Shutting down emulators.
Error: Could not start firestore emulator, port taken.

Эта ошибка выдается каждый раз, когда я запускаю команду exe c. Может кто-нибудь указать, что может быть не так?

Редактировать: Журналы с эмуляторов Firebase: запуск

firebase emulators:start
i  emulators: Starting emulators: functions, firestore, hosting, pubsub
✔  hub: emulator hub started at http://localhost:4400
⚠  Your requested "node" version "8" doesn't match your global version "10"
✔  functions: functions emulator started at http://localhost:5001
i  firestore: Serving ALL traffic (including WebChannel) on http://localhost:8080
⚠  firestore: Support for WebChannel on a separate port (8081) is DEPRECATED and will go away soon. Please use port above instead.
i  firestore: firestore emulator logging to firestore-debug.log
✔  firestore: firestore emulator started at http://localhost:8080
i  firestore: For testing set FIRESTORE_EMULATOR_HOST=localhost:8080
i  hosting[website]: Serving hosting files from: public
✔  hosting[website]: Local server: http://localhost:5000
i  hosting[admin]: Serving hosting files from: public
✔  hosting[admin]: Local server: http://localhost:5005
i  hosting[b2b]: Serving hosting files from: public
✔  hosting[b2b]: Local server: http://localhost:5006
i  hosting[b2c]: Serving hosting files from: public
✔  hosting[b2c]: Local server: http://localhost:5007
i  hosting[sdk]: Serving hosting files from: public
✔  hosting[sdk]: Local server: http://localhost:5008
✔  hosting: hosting emulator started at http://localhost:5000
i  pubsub: pubsub emulator logging to pubsub-debug.log
✔  pubsub: pubsub emulator started at http://localhost:8085

1 Ответ

0 голосов
/ 02 апреля 2020

Возникла проблема с firepit (автономный интерфейс командной строки, устанавливаемый с помощью curl): # 1868

Установка в виде пакета Node может помочь: npm install -g firebase-tools

Если это уже имеет место, вы, вероятно, должны подать проблему там.

...