묻고 답해요
130만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
서버연결이 안됩니다.
AWS Lightsail ssh 에서 sudo npm run start:prod 를 입력하고 pm2 list을 넣어보았습니다.잘 작동되는 것 같아 서버로 가봤는데 제 nest.js api가 실행되지 않는 걸 보고 pm2 log을 넣어봤는데도 크게 이상이 없는 것 같습니다. 그런데 여전히 들어갈 수가 없네요.postman에서도 http://<IP>/user/test 접근을 시도해도 똑같이 작동이 되지 않습니다. 뭐가 문제일까요?
-
해결됨맛집 지도앱 만들기 (React Native + NestJS)
EncryptedStorage import 오류가 발생합니다.
환경:Macbook Air M2 SonomaVS-CodeRN v0.74.1Metro v0.80.8 문제:아래 명령어로 라이브러리 설치 및 pod install 과정은 모두 완료한 상태입니다. $ yarn add react-native-encrypted-storage$ npx pod-install ios/frontend/utils/encryptStorage.ts에서 EncryptStorage 라이브러리를 불러올 때 다음과 같은 경로로 불러와집니다. 자동완성 기준으로 불러왔으며, 라이브러리 삭제 후 재설치해도 현상은 같습니다. import EncryptedStorage from 'react-native-encrypted-storage/lib/typescript/EncryptedStorage'; 이 경로로 importing된 라이브러리를 파일 내에서 사용하면 정상적으로 메서드가 자동완성 됩니다. (따라서 코딩할 때에는 문제가 되는지 몰랐습니다)이 코드를 바탕으로 앱 실행 시 react-native-encrypted-storage모듈을 불러올 수 없다는 오류가 발생합니다.error: Error: Unable to resolve module react-native-encrypted-storage/lib/typescript/EncryptedStorage from /Users/popo/Desktop/ClipProjects/frontend/src/utils/encryptStorage.ts: react-native-encrypted-storage/lib/typescript/EncryptedStorage could not be found within the project or in these directories: node_modules 1 | import EncryptedStorage from 'react-native-encrypted-storage/lib/typescript/EncryptedStorage'; | ^ 2 | 3 | const setEncryptedStorage = async <T>(key: string, value: T) => { 4 | await EncryptedStorage.setItem(key, JSON.stringify(value)); 해당 모듈 외 문제는 없는 상황 같습니다. 서버 연결 및 응답(로그인, 회원가입에 대해)은 잘 됩니다. 시도해본 것:import EncryptedStorage from 'react-native-encrypted-storage/lib/typescript/EncryptedStorage';를import EncryptedStorage from 'react-native-encrypted-storage'; 로 바꿔 실행해봤는데, 컴파일 오류는 발생하지 않고 로그인 및 회원가입 시점에 eject가 발생합니다. 질문: 왜 이런 문제가 발생하는 것이며, 어떻게 해결할 수 있을까요?
-
해결됨맛집 지도앱 만들기 (React Native + NestJS)
forwardRef를 사용하는 정확한 이유에 대해서 알고싶습니다!
forwardRef를 사용하는 정확한 이유에 대해서 알고싶습니다! 부모 컴포넌트에서 자식 컴포넌트로 ref를 전달하고 싶을때 사용하는게 맞을까요?ref는 자식으로 전달이 불가능한 prop이고 forwardRef를 사용해서, 두번쨰 인자로 ref를 전달하는것으로 이해했는데 혹시 맞을까요!!조금 자세한 설명을 듣고 싶습니다!
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
docker
Access denied for user 'root'@'localhost' (using password: YES) my-backend-1 | Error: connect ECONNREFUSED 172.18.0.2:3306my-backend-1 | at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1487:16)my-database-1 | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'my-backend-1 | [Nest] 42 - 05/02/2024, 6:41:50 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (2)...my-backend-1 | Error: connect ECONNREFUSED 172.18.0.2:3306my-backend-1 | at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1487:16)my-database-1 | 2024-05-02T18:41:49.714242Z 0 [System] [MY-015015] [Server] MySQL Server - start.my-database-1 | 2024-05-02T18:41:50.845054Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.0) starting as process 1my-database-1 | 2024-05-02T18:41:50.991351Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.my-database-1 | 2024-05-02T18:41:51.037335Z 1 [ERROR] [MY-012585] [InnoDB] Linux Native AIO interface is not supported on this platform. Please check your OS documentation and install appropriate binary of InnoDB.my-database-1 | 2024-05-02T18:41:51.037785Z 1 [Warning] [MY-012654] [InnoDB] Linux Native AIO disabled.my-database-1 | 2024-05-02T18:41:51.786685Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.my-backend-1 | [Nest] 42 - 05/02/2024, 6:41:53 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (3)...my-backend-1 | Error: connect ECONNREFUSED 172.18.0.2:3306my-backend-1 | at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1487:16)my-database-1 | 2024-05-02T18:41:53.236794Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.my-database-1 | 2024-05-02T18:41:53.237258Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.my-database-1 | 2024-05-02T18:41:53.247163Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.my-database-1 | 2024-05-02T18:41:53.454585Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.4.0' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL.my-database-1 | 2024-05-02T18:41:53.793849Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sockmy-backend-1 | query: SELECT VERSION() AS versionmy-backend-1 | query: START TRANSACTIONmy-backend-1 | query: SELECT DATABASE() AS db_namemy-backend-1 | query: SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_COMMENT FROM INFORMATION_SCHEMA.`TABLES` WHERE TABLE_SCHEMA = 'mydocker' AND TABLE_NAME = 'board'my-backend-1 | query: SELECT * FROM INFORMATION_SCHEMA.`COLUMNS` WHERE TABLE_SCHEMA = 'mydocker' AND TABLE_NAME = 'typeorm_metadata'my-backend-1 | query: CREATE TABLE board (`number` int NOT NULL AUTO_INCREMENT, writer varchar(255) NOT NULL, title varchar(255) NOT NULL, contents varchar(255) NOT NULL, PRIMARY KEY (`number`)) ENGINE=InnoDBmy-backend-1 | query: COMMITmy-backend-1 | [Nest] 42 - 05/02/2024, 6:41:56 PM LOG [InstanceLoader] TypeOrmCoreModule dependencies initialized +3294msmy-backend-1 | [Nest] 42 - 05/02/2024, 6:41:56 PM LOG [GraphQLModule] Mapped {/graphql, POST} route +68msmy-backend-1 | [Nest] 42 - 05/02/2024, 6:41:56 PM LOG [NestApplication] Nest application successfully started +3ms 안되네요??
-
해결됨맛집 지도앱 만들기 (React Native + NestJS)
createDrawerNavigator를 위로 빼주는 이유에 대해서 알고싶습니다.
createDrawerNavigator를 위로 빼주는 이유에 대해서 알고싶습니다. 왜 function 위로 올리는지 이유에 대해서 궁금합니다!! 공식문서에서 그렇게 나와있기 떄문인가요!?
-
미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
[PM2][ERROR] Command not found
[PM2][ERROR] Command not foundusage: pm2 [options] <command>pm2 -h, --help all available commands and optionspm2 examples display pm2 usage examplespm2 <command> -h help on a specific commandAccess pm2 files in ~/.pm2npm ERR! code ELIFECYCLEnpm ERR! errno 1npm ERR! project@0.0.1 start:prod: pm2 run dist/main.jsnpm ERR! Exit status 1npm ERR! npm ERR! Failed at the project@0.0.1 start:prod script.npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in:npm ERR! /root/.npm/_logs/2024-05-02T14_05_57_337Z-debug.log<AWS 클라우드 VPS 구축 & PM2로 서버 운영하기> 강좌에서 SSH에 마지막 sudo npm run start:prod 코드를 작성했더니 나온 에러입니다. 혹시 어떻게 해결해야할까요? https://github.com/DongGyu123/DOT_G 이게 현재 강의에서 제가 활용한 스터디용 코드입니다.
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - Part 1 NestJS Core
서비스가 복잡해질때 모듈 구성을 어떻게 확장해나가나요?
예를 들어 자산을 관리하는 페이지가 있고나의 자산조회 나의 자산환전나의 자산전송이와 같이 구성되고 여기서 선물이나, 현물로 분기된다고 쳤을때모듈에 모듈이 들어가거나 컨트롤러에 컨트롤러가 중첩되어 들어가는 경우도 생기나요? 가지치기하듯 서비스가 확장되어갈때 어떤 방식으로 구조를 짜야할지 감이 안오네요
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
섹션6 04-05 몽구스 부분 수강중입니다.
backend 폴더 통합 터미널에서 mongoose를 설치하고,docker-compose build를 했는데 이런 에러가 계속해서 뜹니다.해결해보려고 에러 메세지를 읽어보니, mongoose와 my-backend 도커에 설치되는 node가 버전이 안맞는다는 것 같은데, 괜히 손댔다가 문제가 더욱 복잡해질까봐 섣부르게 건드리질 못하겠네요 ㅜㅜ 04-02 강의에서, backend 도커에 coolsms 가 설치되지 않았다고 하여 Dockerfile에개인적으로 이 코드를 추가해준 걸 제외하면 04-04까지 수강하는데 문제는 없었습니다.RUN yarn add coolsms-node-sdk어떻게 해야될까요?
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
백엔드 과정을 수강 중인 학생입니다.
잘 몰라서 아는 지인에게 궁금해서 물어봤더니 도커라는 것을 받아서 거기에 리눅스 이미지로 올려서 쓰는게 있다고 하는데 그렇게 해서 수강해도 문제가 없을까요 ?또는 유튜브에 WSL2 Ubuntu 설치하는 방법도 있던데 이걸로 해도 수강에 문제 없을까요? 답변 부탁드립니다 ㅠㅠ
-
미해결맛집 지도앱 만들기 (React Native + NestJS)
pressed? 적용 후 버튼 클릭해도 색상이 변하지 않는 경우 [해결 방법]
프로젝트 재실행하면 되네요!! 참고하시길...npx react-native start --reset-cache
-
미해결맛집 지도앱 만들기 (React Native + NestJS)
marker.d.ts 관련
강의에 나오는것처럼 진행했을때 import {LatLng, MapMarkerProps} from 'react-native-maps'; declare module 'react-native-maps' { export interface MyMapMarkerProps extends MapMarkerProps { coordinate?: LatLng; } } 'MyMapMarkerProps' 인터페이스가 'MapMarkerProps' 인터페이스를 잘못 확장합니다.'MyMapMarkerProps' 형식은 '{ anchor?: Point | undefined; calloutAnchor?: Point | undefined; calloutOffset?: Point | undefined; centerOffset?: Point | undefined; coordinate: LatLng; ... 22 more ...; zIndex?: number | undefined; }' 형식에 할당할 수 없습니다.'coordinate' 속성의 형식이 호환되지 않습니다.'LatLng | undefined' 형식은 'LatLng' 형식에 할당할 수 없습니다.'undefined' 형식은 'LatLng' 형식에 할당할 수 없습니다.ts(2430)⚠ Error (TS2430) | MyMapMarkerProps 인터페이스가 MapMarkerProps 인터페이스를 잘못 확장합니다. MyMapMarkerProps 형식은 { anchor?: Point | undefined; calloutAnchor?: Point | undefined; calloutOffset?: Point | undefined; centerOffset?: Point | undefined; coordinate: LatLng; ... 22 more ...; zIndex?: number | undefined; } 형식에 할당할 수 없습니다.동일하게 ?을 넣을 수없는 에러가 생겨서 import {LatLng, MapMarkerProps} from 'react-native-maps'; declare module 'react-native-maps' { export interface MyMapMarkerProps extends Partial<MapMarkerProps> { coordinate?: LatLng; } } 우선 아래와 같이 처리해 보았습니다만 CustomMarker.tsx에서 MyMapMarkerProps를 못불러오는 문제가 있습니다.
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - Part 1 NestJS Core
RefreshTokenGuard 관련 문제
해당 강좌 아래 질문들을 보면 RefreshTokenGuard 관련하여 문제가 있는 것 같은데, 정확히 어떤 문제인지 아직 이해가 안되어서, 혹시 설명을 조금 자세하게 해주실 수 있을까요?
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - Part 1 NestJS Core
강의 너무 잘 듣고 있습니다 혹시 part2는 언제쯤 나올까요?
언제쯤 나올까요 ㅠㅠ 강사님 너무 잘가르치십니다
-
미해결맛집 지도앱 만들기 (React Native + NestJS)
Nested Navigation 구조 설계에 대한 질문 드려도되나요?
안녕하세요 강사님강의 내에서 구성한 Nested Navigation 구조를 참고하여 무신사(musinsa)와 같은 화면 구성을 시도해 보고 있는데 navigation 구조 설계가 생각보다 어려워서 질문 드립니다.원하는 구조는 Bottom Tab에 따라서 Topbar Screen에 해당하는 부분에 장바구니와 알림 버튼이 들어가게 하고싶은데 아래와 같은 navigation 설계로 가능한지 질문드립니다.AuthStackNavigatorAuthHomeScreenKakaoLoginScreenBottomTabNavigatorHomeStackTopbarScreenHomeScreenStoreStackMypageStack ❗질문 작성시 참고해주세요최대한 상세히 현재 문제(또는 에러)와 코드(또는 github)를 첨부해주셔야 그만큼 자세히 답변드릴 수 있습니다.맥/윈도우, 안드로이드/iOS, 버전 등의 개발환경도 함께 적어주시면 도움이 됩니다. 에러메세지는 일부분이 아닌 전체 상황을 올려주세요!
-
해결됨맛집 지도앱 만들기 (React Native + NestJS)
nest.js와 typeORM 지식이 있어야할까요?
강의 후반부에 백엔드를 공부하기 위해선 react-query처럼 선수지식이 있어야될까요?
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - Part 1 NestJS Core
password is required 오류
docker-compose up 이후에 postgres 확장자를 이용하여 연결하려고 할 때 모든 과정 이후에 password is required 오류가 뜹니다 ㅠㅠ포트 변경 후에도 동일하고postgres-data 폴더 삭제 -> 생성 후에도 동일합니다ㅠㅠ
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - Part 1 NestJS Core
5분 경에 질문있습니다.
@Post() @UseGuards(AccessTokenGuard) @UseInterceptors(TransactionInterceptor) async postPost(@User("id") userId: number, @Body() body: CreatePostDto, @QueryRunner() qr: QR) { // temp -> posts로 옮긴다음에 포스팅 const post = await this.postsService.createPost(userId, body, qr); // throw new InternalServerErrorException("에러가 생겼습니다."); // 포스트만 생성하고, 이미지는 생성안해버림 throw 에러에서 걸림. 원래는 포스트 게시글이 생기면 안됨. for (let i = 0; i < body.images.length; i++) { await this.PostsImagesService.createPostImage( { post, order: i, path: body.images[i], type: ImageModelType.POST_IMAGE, }, qr, ); } // Transaction 타입에 따라서 Transaction이 커밋 되기전에 최신 값을 가져오지 못할 수 있다. (service에서 해당 문제 처리 직접 qr받아서) // 가장 최근상태의 포스트를 받아와서, 반환해줌. return this.postsService.getPostById(post.id, qr);Transaction 타입에 따라서 Transaction이 커밋 되기 전에 최신 값을 가져오지 못할 수 있다고 하셔서, getPostById service에서 직접적으로 qr을 주입받아서, 사용했는데 정확히 어떤 이유로 최신 값을 못받아오는지 잘 이해가 안가서, 자세히 설명을 해주실 수 있나요?
-
해결됨맛집 지도앱 만들기 (React Native + NestJS)
프로젝트가 만들어지지 않습니다.
맥북 m1으로 똑같이 설정을 했습니다.그리고 npx react-native init MatzipApp으로 프로젝트를 실행하면 아래오 같은 메시지가 나옵니다. Downloading template ✔ Copying template ⠸ Processing template➤ YN0000: Retrieving https://repo.yarnpkg.com/3.6.4/packages/yarnpkg-cli/bin/yarn.js ⠙ Processing template➤ YN0000: Saving the new release in ../../../.yarn/releases/yarn-3.6.4.cjs ➤ YN0000: Done in 0s 666ms ⠼ Processing template➤ YN0000: Successfully set nodeLinker to 'node-modules' ✔ Processing template ⠸ Installing dependencieserror Installing pods failed. This doesn't affect project initialization and you can safely proceed. However, you will need to install pods manually when running iOS, follow additional steps in "Run instructions for iOS" section. ✖ Installing dependencies info 💡 To enable automatic CocoaPods installation when building for iOS you can create react-native.config.js with automaticPodsInstallation field. For more details, see https://github.com/react-native-community/cli/blob/main/docs/projects.md#projectiosautomaticpodsinstallation ✔ Initializing Git repository Run instructions for Android: • Have an Android emulator running (quickest way to get started), or a device connected. • cd "/Users/xxx/React-Project/React-Native/MatzipApp" && npx react-native run-android Run instructions for iOS: • cd "/Users/sss/React-Project/React-Native/MatzipApp/ios" • Install Cocoapods • bundle install # you need to run this only once in your project. • bundle exec pod install • cd .. • npx react-native run-ios - or - • Open MatzipApp/ios/MatzipAppcd .xcodeproj in Xcode or run "xed -b ios" • Hit the Run button Run instructions for macOS: • See https://aka.ms/ReactNativeGuideMacOS for the latest up-to-date instructions.이런 메시지가 뜨고 npm run start로 실행을 하면 command not found메시지가 뜨면서 애뮬레이터도 실행이 안됩니다.ㅠㅠ
-
해결됨맛집 지도앱 만들기 (React Native + NestJS)
[6-7] FeedDetail화면에서 뒤로가기시(goBack) 질문
안녕하세요.하단 탭 메뉴 중 즐겨찾기 탭으로 이동하여 FeedItem 선택 후 FeedDetail 화면으로 이동한 후 뒤로 가기를 누르면 즐겨찾기 탭 으로 가는게 아니라 FeedHome 탭으로 이동합니다.즐겨찾기탭으로 돌아가게 하려면 어떻게 해야 될까요. ❗질문 작성시 참고해주세요최대한 상세히 현재 문제(또는 에러)와 코드(또는 github)를 첨부해주셔야 그만큼 자세히 답변드릴 수 있습니다.맥/윈도우, 안드로이드/iOS, 버전 등의 개발환경도 함께 적어주시면 도움이 됩니다. 에러메세지는 일부분이 아닌 전체 상황을 올려주세요!
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - Part 1 NestJS Core
docker-compose.yml 파일 환경변수 관리
안녕하세요,docker-compose.yml 파일 같은 경우는 .gitignore 처리를 하는 파일인지, 아니면 이 부분도 환경변수로 데이터 접근하는 값들을 환경변수로 바꿔줘야하는지 어떻게 관리하는지 알고 싶어 질문드립니다.