我一直在尝试使用云函数仿真器在本地测试我的云函数,但似乎不起作用。当我运行时会发生什么:
firebase emulators:start我得到了以下信息:
i emulators: Starting emulators: functions
+ hub: emulator hub started at http://localhost:4400
i emulators: Shutting down emulators.
i hub: Stopping emulator hub
Error: An unexpected error has occurred.
Having trouble? Try again or contact support with contents of firebase-debug.log这是我的firebase.json的样子:
{
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint"
]
},
"emulators": {}
}我试过运行firebase init和firebase init emulators几次,但到目前为止都没有成功。
登录的帐户对其具有编辑权限。请帮帮我,我真的需要这个。
发布于 2020-05-06 19:45:55
我已经试过运行
,firebase init几次了,还有firebase init模拟器,但到目前为止都没有成功。
参见https://firebase.google.com/docs/emulator-suite/install_and_configure。
You will need CLI version 7.8.0 or higher to use the Emulator Sute.首先,您可以检查您的节点版本和firebase版本吗?
下面的日志是我本地机器上的命令历史日志。
$ node -v
v10.20.1
$ firebase -V
8.2.0
$ firebase emulators:start
i emulators: Starting emulators: firestore
i firestore: downloading cloud-firestore-emulator-v1.11.3.jar...
Progress: ====================================================================================================> (100% of 64MB
i firestore: Removing outdated emulator files: cloud-firestore-emulator-v1.10.2.jar
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
✔ emulators: All emulators started, it is now safe to connect..firebaserc
{}firebase.json
{
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"emulators": {
"firestore": {
"port": 8080
}
}
}发布于 2020-09-08 18:03:28
我也看到了这一点,但是创建一个构建版本为我解决了这个问题,例如npm run build或yarn build
这将重新创建node_modules,并可能更新锁文件以同步依赖项
https://stackoverflow.com/questions/61629931
复制相似问题