ํจํค์ง.json:
"firebase-admin": "^8.12.1",
"firebase-functions": "^3.7.0",
Firebase ๋๊ตฌ:
8.4.2
ํ๋ซํผ:
์ฐฝ
Firebase ์๋ฎฌ๋ ์ดํฐ:์์
ํจ์๋ Firestore ์๋ฎฌ๋ ์ดํฐ์ ์ฐ๊ฒฐ๋์ด์ผ ํฉ๋๋ค.
! Your requested "node" version "8" doesn't match your global version "10"
i functions: Watching "D:\Workspace\a\Cloud Functions\project\functions" for Cloud Functions...
+ functions[helloWorld]: http function initialized (http://localhost:5000/[project-id]/us-central1/helloWorld).
i functions[countentitities]: function ignored because the database emulator does not exist or is not running.
@ahmadalibaloch ์ด๊ฒ์ ์๋ํ ๋๋ก ์๋ํฉ๋๋ค. ๋ฐ์ดํฐ๋ฒ ์ด์ค ์๋ฎฌ๋ ์ดํฐ๊ฐ ์๋ ํจ์ ์๋ฎฌ๋ ์ดํฐ๋ง ์คํํ๊ณ ์์ต๋๋ค.
๋ ๋ค ์คํํ๋ ค๋ฉด ๋จผ์ firebase init emulators
๋ฅผ ์คํํ๊ณ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์๋ฎฌ๋ ์ดํฐ๋ฅผ ์ค์ ํ ๋ค์ firebase emulators:start
๋ฅผ ๋ค์ ์คํํ์ญ์์ค.
์๋ฎฌ๋ ์ดํฐ์ UI์์ Firestore ์๋ฎฌ๋ ์ดํฐ์ ์ก์ธ์คํ๊ณ DB๋ฅผ ๋ณ๊ฒฝํ ์ ์์ผ๋ฉฐ ๋ชจ๋ ๊ฒ์ด ์ ๋๋ก ์๋ํฉ๋๋ค.
firebase init emulators
๋ก ์๋ฎฌ๋ ์ดํฐ๋ฅผ ์ค์ ํ์ง๋ง ์๋ฎฌ๋ ์ดํฐ๋ฅผ ์์ํ ํ ๊ธฐ๋ฅ์ ์ ๊ณตํ๋ฉด function ignored bcause the database emulator does not exist....
๋ฉ์์ง๊ฐ ํ์๋ฉ๋๋ค.
@ahmadalibaloch ์ด๊ฒ์ ๋๋ฒ๊ทธํ๊ธฐ์ ์ถฉ๋ถํ ์ ๋ณด๊ฐ ์๋๋๋ค. ๋ฐ์ดํฐ๋ฒ ์ด์ค ์๋ฎฌ๋ ์ดํฐ๊ฐ ์คํ ์ค์ด์ง๋ง ํจ์ ์๋ฎฌ๋ ์ดํฐ๊ฐ ์ธ์ํ์ง ๋ชปํ๋ emulators:start
์ ๋๋ฒ๊ทธ ๋ก๊ทธ๋ฅผ ์ต์ํ ํ์ํ์ญ์์ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
@ahmadalibaloch ์ด๊ฒ์ ์๋ํ ๋๋ก ์๋ํฉ๋๋ค. ๋ฐ์ดํฐ๋ฒ ์ด์ค ์๋ฎฌ๋ ์ดํฐ๊ฐ ์๋ ํจ์ ์๋ฎฌ๋ ์ดํฐ๋ง ์คํํ๊ณ ์์ต๋๋ค.
๋ ๋ค ์คํํ๋ ค๋ฉด ๋จผ์
firebase init emulators
๋ฅผ ์คํํ๊ณ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์๋ฎฌ๋ ์ดํฐ๋ฅผ ์ค์ ํ ๋ค์firebase emulators:start
๋ฅผ ๋ค์ ์คํํ์ญ์์ค.