5. 로컬 서버 실행─── Toy Project/Firebase - FriendlyEats2024. 9. 25. 14:53
Table of Contents
터미널 경로
$ pwd
/Users/user1/Firebase/friendlyeats-web/vanilla-js
* CLI start 해보기
Users/user1/Firebase/friendlyeats-web/vanilla-js>
$ firebase emulators:start --only hosting
Codelab에서는
hosting: Local server: http://localhost:5000
5000이라지만
내 로컬에선 localhost:5002라고 한다.
$ firebase emulators:start --only hosting
(node:15159) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
i emulators: Starting emulators: hosting
⚠ logging: Logging Emulator unable to start on port 4500, starting on 4501 instead.
⚠ hosting: Hosting Emulator unable to start on port 5000, starting on 5002 instead.
i hosting[friendlyeats-8fa1e]: Serving hosting files from: ./
✔ hosting[friendlyeats-8fa1e]: Local server: http://127.0.0.1:5002
⚠ emulators: The Emulator UI is not starting, either because none of the running emulators have a UI component or the Emulator UI cannot determine the Project ID. Pass the --project flag to specify a project.
┌─────────────────────────────────────────────────────────────┐
│ ✔ All emulators ready! It is now safe to connect your app. │
└─────────────────────────────────────────────────────────────┘
┌──────────┬────────────────┐
│ Emulator │ Host:Port │
├──────────┼────────────────┤
│ Hosting │ 127.0.0.1:5002 │
└──────────┴────────────────┘
Emulator Hub running at 127.0.0.1:4400
Other reserved ports: 4501
Issues? Report them at https://github.com/firebase/firebase-tools/issues and attach the *-debug.log files.
만약 브라우저에서 localhost:5002 했는데 Terminal에서 [getTime에 대한 TypeError] 오류나면,
node 버전이 안 맞는 것. 게시글 4.대로 node v20로 했더니 바로 됐다.
TypeError: Cannot read properties of undefined (reading 'getTime')
at Responder.provider (/Users/user1/.nvm/versions/node/v22.9.0/lib/node_modules/firebase-tools/node_modules/superstatic/lib/providers/fs.js:89:38)
at async Promise.all (index 0)
i hosting: 127.0.0.1 - - [25/Sep/2024:05:43:13 +0000] "GET / HTTP/1.1" 500 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
TypeError: Cannot read properties of undefined (reading 'getTime')
at Responder.provider (/Users/user1/.nvm/versions/node/v22.9.0/lib/node_modules/firebase-tools/node_modules/superstatic/lib/providers/fs.js:89:38)
i hosting: 127.0.0.1 - - [25/Sep/2024:05:43:13 +0000] "GET /favicon.ico HTTP/1.1" 500 - "http://localhost:5002/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
아래 stackoverflow 게시글 추천도 해봤지만 안됐었음
https://stackoverflow.com/questions/46359322/npm-firebase-tools-install
$ npm i -g firebase-tools -d
// 뭔가 fetch가 많이 간다..
//...............
//...............
//...............
npm http fetch GET 200 https://registry.npmjs.org/is-arrayish 21ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/crc-32 32ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/crc32-stream 30ms (cache revalidated)
npm info run fsevents@2.3.3 install node_modules/firebase-tools/node_modules/fsevents node-gyp rebuild
npm info run re2@1.21.4 install node_modules/firebase-tools/node_modules/re2 install-from-cache --artifact build/Release/re2.node --host-var RE2_DOWNLOAD_MIRROR --skip-path-var RE2_DOWNLOAD_SKIP_PATH --skip-ver-var RE2_DOWNLOAD_SKIP_VER || node-gyp -j max rebuild
npm info run fsevents@2.3.3 install { code: 1, signal: null }
npm info run re2@1.21.4 install { code: 0, signal: null }
npm info run protobufjs@7.4.0 postinstall node_modules/firebase-tools/node_modules/protobufjs node scripts/postinstall
npm info run protobufjs@7.4.0 postinstall { code: 0, signal: null }
added 633 packages in 14s
70 packages are looking for funding
run `npm fund` for details
npm info ok
ㄴ> 이거 안됐었음!
아무튼 잘되는 로그는 이렇게!
* 브라우저에 localhost:5002 호출.
Terminal - hosting
i hosting: 127.0.0.1 - - [25/Sep/2024:06:55:29 +0000] "GET / HTTP/1.1" 200 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
i hosting: 127.0.0.1 - - [25/Sep/2024:06:55:29 +0000] "GET /styles/main.css HTTP/1.1" 200 - "http://localhost:5002/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
i hosting: 127.0.0.1 - - [25/Sep/2024:06:55:29 +0000] "GET /images/guy_fireats.png HTTP/1.1" 200 115603 "http://localhost:5002/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
i hosting: 127.0.0.1 - - [25/Sep/2024:06:55:29 +0000] "GET /__/firebase/9.22.1/firebase-app-compat.js HTTP/1.1" 200 9307 "http://localhost:5002/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
i hosting: 127.0.0.1 - - [25/Sep/2024:06:55:30 +0000] "GET /__/firebase/9.22.1/firebase-auth-compat.js HTTP/1.1" 200 38084 "http://localhost:5002/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
i hosting: 127.0.0.1 - - [25/Sep/2024:06:55:30 +0000] "GET /__/firebase/9.22.1/firebase-app-check-compat.js HTTP/1.1" 200 7767 "http://localhost:5002/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
i hosting: 127.0.0.1 - - [25/Sep/2024:06:55:30 +0000] "GET /__/firebase/init.js HTTP/1.1" 200 - "http://localhost:5002/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
i hosting: 127.0.0.1 - - [25/Sep/2024:06:55:30 +0000] "GET /__/firebase/9.22.1/firebase-firestore-compat.js HTTP/1.1" 200 100742 "http://localhost:5002/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
i hosting: 127.0.0.1 - - [25/Sep/2024:06:55:30 +0000] "GET /scripts/FriendlyEats.js HTTP/1.1" 200 - "http://localhost:5002/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
i hosting: 127.0.0.1 - - [25/Sep/2024:06:55:30 +0000] "GET /scripts/FriendlyEats.View.js HTTP/1.1" 200 - "http://localhost:5002/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
i hosting: 127.0.0.1 - - [25/Sep/2024:06:55:30 +0000] "GET /scripts/FriendlyEats.Mock.js HTTP/1.1" 200 - "http://localhost:5002/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
i hosting: 127.0.0.1 - - [25/Sep/2024:06:55:30 +0000] "GET /scripts/FriendlyEats.Data.js HTTP/1.1" 200 - "http://localhost:5002/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
i hosting: 127.0.0.1 - - [25/Sep/2024:06:55:31 +0000] "GET /images/favicon.ico HTTP/1.1" 200 - "http://localhost:5002/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
i hosting: 127.0.0.1 - - [25/Sep/2024:06:55:31 +0000] "GET /manifest.json HTTP/1.1" 200 279 "http://localhost:5002/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
i hosting: 127.0.0.1 - - [25/Sep/2024:06:55:31 +0000] "GET /images/icons/fireeats-192x192.png HTTP/1.1" 200 12544 "http://localhost:5002/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
chrome browser - localhost:5002
조금 로딩이 걸렸지만 드디어...!!!!!!!!!!
'─── Toy Project > Firebase - FriendlyEats' 카테고리의 다른 글
7. Cloud Firestore의 데이터 표시 (0) | 2024.09.26 |
---|---|
6. Cloud Firestore에 데이터 쓰기 (0) | 2024.09.26 |
4. Firebase 명령줄 인터페이스 설치 (0) | 2024.09.25 |
3. 샘플 코드 가져오기 (0) | 2024.09.25 |
2. Firebase 프로젝트 만들기 및 설정 (0) | 2024.09.25 |