安装了 firebase 模拟器,但它不起作用,仍然需要安装

时间:2021-02-10 04:01:04

标签: firebase

显然我曾经做过以下事情:

$ firebase login
$ firebase init
$ firebase init emulators

...skip

i  Port for functions already configured: 5001
i  Port for firestore already configured: 8080
i  Port for database already configured: 9000
i  Port for hosting already configured: 5000
i  Port for pubsub already configured: 8085
i  Emulator UI already enabled with port: (automatic)
? Would you like to download the emulators now? Yes
i  ui: downloading ui-v1.4.1.zip...

i  Writing configuration info to firebase.json...
i  Writing project information to .firebaserc...

✔  Firebase initialization complete!

但是当我尝试 firebase emulators:start --only hosting:my_project_target_name 时,我收到以下消息。

$ firebase emulators:start --only hosting:my_project_target_name
i  emulators: Shutting down emulators.

Error: No emulators to start, run firebase init emulators to get started.

我的开发环境如下。

  • nodejs: v12.20.1
  • firebase:v9.3.0
  • java: openjdk v1.8.0_275
  • 操作系统:ubuntu 20.04

我在 sudo su 之后再次尝试,但结果是一样的。 我该怎么办?


添加内容。

它只适用于:

$ sudo firebase emulators:start --only hosting

i  emulators: Starting emulators: hosting
...
hosting[TARGET_NAME_!]: Local server: http://localhost:5000
...
hosting[TARGET_NAME_2]: Local server: http://localhost:5005

我只想测试托管一个项目。

0 个答案:

没有答案