묻고 답해요
160만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결지금 당장 NodeJS 백엔드 개발 [사주 만세력]
VueJs(프로트엔드) 오류
PS C:\Users\jagit\SSYW\saju-frontend-vuejs-master> npm installnpm WARN config global --global, --local are deprecated. Use --location=global instead.npm ERR! code ERESOLVEnpm ERR! ERESOLVE could not resolvenpm ERR! npm ERR! While resolving: vuetify-loader@1.9.2npm ERR! Found: vue@2.6.11npm ERR! node_modules/vuenpm ERR! vue@"2.6.11" from the root projectnpm ERR! peerOptional vue@"^2 || ^3.0.0-0" from @vue/babel-preset-app@4.5.17npm ERR! node_modules/@vue/babel-preset-appnpm ERR! @vue/babel-preset-app@"^4.5.17" from @vue/cli-plugin-babel@4.5.17npm ERR! node_modules/@vue/cli-plugin-babelnpm ERR! dev @vue/cli-plugin-babel@"~4.5.15" from the root projectnpm ERR! 3 more (vue-axios, vuetify, vuex)npm ERR! npm ERR! Could not resolve dependency:npm ERR! peer vue@"^2.7.2" from vuetify-loader@1.9.2npm ERR! node_modules/vuetify-loadernpm ERR! dev vuetify-loader@"^1.7.0" from the root projectnpm ERR! npm ERR! Conflicting peer dependency: vue@2.7.14npm ERR! node_modules/vuenpm ERR! peer vue@"^2.7.2" from vuetify-loader@1.9.2npm ERR! node_modules/vuetify-loadernpm ERR! dev vuetify-loader@"^1.7.0" from the root projectnpm ERR! npm ERR! Fix the upstream dependency conflict, or retrynpm ERR! this command with --force, or --legacy-peer-depsnpm ERR! to accept an incorrect (and potentially broken) dependency resolution.npm ERR! npm ERR! See C:\Users\jagit\AppData\Local\npm-cache\eresolve-report.txt for a full report.npm ERR! A complete log of this run can be found in:npm ERR! C:\Users\jagit\AppData\Local\npm-cache\_logs\2023-01-28T07_03_01_187Z-debug-0.logPS C:\Users\jagit\SSYW\saju-frontend-vuejs-master> npm run servenpm WARN config global --global, --local are deprecated. Use --location=global instead.> saju-frontend-vuejs@0.1.0 serve> vue-cli-service serve'vue-cli-service'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는배치 파일이 아닙니다.PS C:\Users\jagit\SSYW\saju-frontend-vuejs-master> 오류납니다. 도와주세요!
-
미해결지금 당장 NodeJS 백엔드 개발 [사주 만세력]
postman 사용 중 애러
어찌해야 할지 모르겠네요. help me
-
미해결따라하며 배우는 NestJS
뒷 부분 공부하고 싶습니다!
강의 뒷 부분이 너무 궁금합니다!다른 비슷한 질문에 올라온 답변의 url은 다른 사람은 못 보게 돼 있는 것 같습니다.. 자료를 따로 받을 순 없는건가요??
-
미해결따라하며 배우는 NestJS
update를 repository로 빼서 작성했는데 오류가 나옵니다
boards.service.ts 코드입니다.import { Injectable, NotFoundException } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { BoardStatus } from './board-status.enum'; import { Board } from './board.entity'; import { BoardRepository } from './board.repository'; import { CreateBoardDto } from './dto/create-board.dto'; @Injectable() export class BoardsService { constructor( @InjectRepository(Board) private boardRepository: BoardRepository, ) {} createBoard(createBoardDto: CreateBoardDto): Promise<Board> { return this.boardRepository.createBoard(createBoardDto); } async getBoardById(id: number): Promise<Board> { console.log(id, 'ididid'); return this.boardRepository.getBoardById(id); } async deleteBoard(id: number): Promise<void> { const result = await this.boardRepository.delete(id); if (result.affected == 0) { throw new NotFoundException(`Can't find Board with id ${id}`); } } async updateBoardStatus(id: number, status: BoardStatus): Promise<Board> { const board = await this.getBoardById(id); board.status = status; await this.boardRepository.save(board); return board; } } board.repository.ts 코드입니다import { Injectable, NotFoundException } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { BoardStatus } from './board-status.enum'; import { Board } from './board.entity'; import { BoardRepository } from './board.repository'; import { CreateBoardDto } from './dto/create-board.dto'; @Injectable() export class BoardsService { constructor( @InjectRepository(Board) private boardRepository: BoardRepository, ) {} createBoard(createBoardDto: CreateBoardDto): Promise<Board> { return this.boardRepository.createBoard(createBoardDto); } async getBoardById(id: number): Promise<Board> { console.log(id, 'ididid'); return this.boardRepository.getBoardById(id); } async deleteBoard(id: number): Promise<void> { const result = await this.boardRepository.delete(id); if (result.affected == 0) { throw new NotFoundException(`Can't find Board with id ${id}`); } } async updateBoardStatus(id: number, status: BoardStatus): Promise<Board> { const board = await this.getBoardById(id); board.status = status; await this.boardRepository.save(board); return board; } } [Nest] 12296 - 2023. 01. 26. 오후 4:25:43 ERROR [ExceptionsHandler] this.boardRepository.getBoardById is not a functionTypeError: this.boardRepository.getBoardById is not a function at BoardsService.getBoardById (C:\Users\lgh38\Desktop\GH\nest-board-app\src\boards\boards.service.ts:22:33) at BoardsService.updateBoardStatus (C:\Users\lgh38\Desktop\GH\nest-board-app\src\boards\boards.service.ts:33:30) at BoardsController.updateBoardStatus (C:\Users\lgh38\Desktop\GH\nest-board-app\src\boards\boards.controller.ts:44:31)오류 내용은 위와 같습니다. 자세히 보면 this.boardRepository.getBoardById is not a function이라고 나오는데 제가 생각 했을 땐 처음 service의 updateBoardStatus 함수에서 getBoardById 함수로 넘겨주고 또 getBoardById 함수가 repository 안에 있는 getBoardById 함수에게 값을 넘겨서 두 번 리턴 받아서 해결 될 줄 알았는데 에러가 나오더라구요..오히려 분리를 안 시켰을 땐 오류가 안 나옵니다 무슨 이유일까요..?
-
미해결[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
제로초스쿨 커뮤니티 슬랙에 들어갈수없습니다....!
안녕하세요, 제로초 스쿨 커뮤니티 에 들어갈 수 없는데..... 이제 슬랙을 운영하시지 않으시는건가요 ??
-
미해결따라하며 배우는 NestJS
findOne() undefined 이유 아시는분
async validate(payload) { const { username } = payload; console.log(username); console.log(payload); const user: User = await this.userRepository.findOne(username); if (!user) { throw new UnauthorizedException('error'); } return user; } }logleejinleejinseong{ username: 'leejinleejinseong', iat: 1674638178, exp: 1674641778 }위 로그처럼 데이터는 로그에 찍히는데 왜 findOne에서 undefined 나올까요? 이유 아시는분..2시간 박치기하고있습니다..덜덜;;; 별짓 다해봐도 해결이 안되네요;;
-
미해결스프링부트 시큐리티 & JWT 강의
logout 기능 오류
강사님이 작성한 코드대로 진행을 하여 로그인 기능과 jwt발급, 검증 하는 부분까지 전부 정상작동 하는것 까지 확인했습니다.다만 postman 으로 Header에 jwt토큰 값을 넣고 post방식으로 /logout 메서드를 호출하였으나 404 에러가 뜨고 path는 logout이 아닌 login으로 응답이 내려옵니다.디폴드 로그아웃 url이 /logout 으로 알고 있어서 별도의 로그아웃 기능을 구현하지 않는 상태인데 제가 잘못 알고 있는 것이 있을까요 ???
-
미해결지금 당장 NodeJS 백엔드 개발 [사주 만세력]
[nodemon] app crashed - waiting for file changes before starting...
PS C:\Users\jagit\SSYW\saju-backend-nodejs-master> npm installnpm WARN config global --global, --local are deprecated. Use --location=global instead.up to date, audited 265 packages in 3s26 packages are looking for funding run npm fund for details8 vulnerabilities (6 moderate, 2 high)To address issues that do not require attention, run: npm audit fixTo address all issues (including breaking changes), run: npm audit fix --forceRun npm audit for details.PS C:\Users\jagit\SSYW\saju-backend-nodejs-master> npm run devnpm WARN config global --global, --local are deprecated. Use --location=global instead.> saju-backend-nodejs@1.0.0 dev> nodemon server[nodemon] 2.0.16[nodemon] to restart at any time, enter rs[nodemon] watching path(s): .[nodemon] watching extensions: js,mjs,json[nodemon] starting node server.jsC:\Users\jagit\SSYW\saju-backend-nodejs-master\node_modules\@slack\webhook\dist\IncomingWebhook.js:15 throw new Error('Incoming webhook URL is required'); ^Error: Incoming webhook URL is required at new IncomingWebhook (C:\Users\jagit\SSYW\saju-backend-nodejs-master\node_modules\@slack\webhook\dist\IncomingWebhook.js:15:19) at Object.<anonymous> (C:\Users\jagit\SSYW\saju-backend-nodejs-master\app\commons\slack.js:2:17) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.<anonymous> (C:\Users\jagit\SSYW\saju-backend-nodejs-master\server.js:7:15) at Module._compile (node:internal/modules/cjs/loader:1105:14)[nodemon] app crashed - waiting for file changes before starting... 여기서 부터 진행이 않됩니다. 도와주세요^^
-
미해결지금 당장 NodeJS 백엔드 개발 [사주 만세력]
Error response from daemon: Ports are not available
PS B:\SSYW\saju-backend-nodejs-master> docker-compose up -d[+] Running 12/12[+] Running 1/2 - Network saju-backend-nodejs-master_default Created 9.3s - Container saju_nodejs_mysql Starting 42.3sError response from daemon: Ports are not available: exposing port TCP 0.0.0.0:3309 -> 0.0.0.0:0: listen tcp 0.0.0.0:3309: bind: An attempt was made to access a socket in a way forbidden by its access permissions.PS B:\SSYW\saju-backend-nodejs-master> 죄송한데요. 포트를 사용할 수가 없습니다. 해결 방법좀 가르쳐 주세요. ~~
-
미해결지금 당장 NodeJS 백엔드 개발 [사주 만세력]
docker-compose up -d no configuration file provided: not found
PS B:\SSYW\saju-backend-nodejs-master> docker-compose up -dno configuration file provided: not found 이렇게 나옵니다. 어떻게 하면 해결할 수 있나요? 도커는 설치되어 있습니다.처음엔 되었는데(import?) , sql 워크브렌치 하다가 이상하게 되었습니다.해결 부탁합니다.
-
미해결따라하며 배우는 NestJS
회원가입 기능 구현
#7-2 회원가입 기능구현에서 강의 내용 전체 작성 후 회원가입 진행하였는데, username과 password가 컨트롤러에서 console.log(authCredentialDto)를 찍으니 빈 객체만 내뱉고 있고 db에 정상적으로 저장이 되지 않았습니다. 이리저리 코드를 수정해보니.dto 구성 단게에서 validator import 후에 정상적으로 출력이 됩니다. 강의 영상에서는 문제 없이 되던데 왜 이렇게 되는지 궁금합니다.
-
미해결따라하며 배우는 NestJS
구현 완료 후 TypeError: this.userRepository.createUser is not a function
TypeError: this.userRepository.createUser is not a function포스트맨에서 localhost:3000/auth/signup실행시 서버가 터지며ㅑㄴ서TypeError: this.userRepository.createUser is not a function이런 에러를 내보내고 있는데, 아무리봐도 코드는 모두 똑같아서 무슨 문제인지 찾아지지가 않네요ㅠ
-
미해결스프링부트 시큐리티 & JWT 강의
intelliJ jdk11 oauth로그인 에러 문제입니다.
안녕하세요 훌륭한 강의를 잘 듣고있는 학생입니다.다름이 아니라 제가 oauth로그인을 하면 오류가 발생하여 문의드립니다.우선 저는 jdk11과 Gradle을 사용하고있습니다.위와 같이 잘 작동하다가 아래와 같이 oauth로그인을 사용하면 에러가 발생합니다.Parameter 0 of method setFilterChains in org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration required a bean of type 'org.springframework.security.oauth2.client.registration.ClientRegistrationRepository' that could not be found.에러의 총 내용은 위와 같습니다.그래서 다른 질문들의 답변을 보니 라이브러리의 충돌 및 다운로드의 문제인거 같아 intelliJ에서 제공하는 invalidate cache기능을 사용하여 다시 재빌드를 하였지만 같은 에러가 발생하고 .\gradlew --refresh-dependencies를 사용하여 재빌드 또한 진행하였지만 같은 결과가 나왔습니다. 마지막으로 toolbox 및 인텔리제이를 다시 실행해도 같은 현상이 발생합니다. 혹시 방법을 알 수 있을까요??
-
미해결따라하며 배우는 NestJS
강의 잘들었습니다! 배포 자료 받을수있을까요?
안녕하세요. 강의 잘들었습니다. 감사합니다.그런데 마지막에보여주신 배포관련 pdf 볼수있을까요? 다른분이 질문해주신 답글https://drive.google.com/file/d/1z3QUaECsZ_bVHIUF-rYyDrNv_oCvR8re/view?usp=sharing여기에는 한장의 사진만 보여서요!
-
해결됨Spring Boot JWT Tutorial
일반 스프링에서 진행
제가 사정이 있어서(학교 프로젝트) 스프링으로 진행을 해야 할 것 같은데, 스프링(메이븐,마이바티스)으로도 진행이 가능한가요?맨처음부터 포스트맨으로 진행시 바로 hello가 떠버려서 멘붕입니다 ㅜㅜ
-
미해결스프링부트 시큐리티 & JWT 강의
JWT Token 구현에서 Session 을 사용한다?
안녕하세요 강사님. 이번 수업 너무 잘 들은 학생입니다.다름이 아니라 JWT Token 을 필터단에서 Security에게 인가처리를 맡기기 위해 Security Context 에 Authentication을 저장한다고 하셨습니다.이는 스프링 내 세션에 인증 객체를 저장해 두는 것으로 이해를 하였습니다. 1.수업중에도 설명해주셨듯이, 토큰을 사용하는 것은 세션에 인증 객체를 저장하지 않도록 해서 서버적으로 부하가 걸리는 상황을 방지하는 점이 큰 장점으로 이해하였으나, 결국 시큐리티에 인가를 맡기려면 세션에 저장하는 방법 밖에 없는지 궁금합니다. 필터들 사이에서 Authentication 정보를 주고 받아야 하니 스프링 시큐리티를 사용하려면 세션 저장 말고는 방법이 없는걸까요?2.계속 생각하다보니 또 궁금해진 사항인데, [SecurityContextHolder 에 세션 정보를 저장해두는 것이 SpringSecurity 가 일반적으로 채택하고 있는 formLogin 방식에서 사용하는 세션 저장 방식]인 것으로 이해를 했습니다. 이 때, 왜 이 부분이 계속 세션을 저장해서 서버적으로 부하가 걸리게 하는 건지 잘 이해를 못한 것 같습니다. Authentication 과정을 살펴보면 그 때 인증을 하기 위해 형성한 Authentication 객체는 그 요청을 처리하기 위해 Thread Local 에 있는 SecurityContextHodler 에 저장을 해두고 인가를 처리하게 됩니다. 하지만 그 과정을 끝내고 나면 Holder를 비워주고, THread도 종료되기 때문에 서버 자체에는 딱히 저장되는 것은 없지 않나요? 보안적인 측면 외의 SESSION 방식의 단점을 잘 이해하지 못한 것 같습니다. 간략하게 라도 도움주시면 감사할 것 같습니다. 2번을 먼저 이해해보는게 1번을 이해하는데 도움이 될 것 같긴 하네요. 강의도 너무 잘들었습니다. 미리 감사드립니다.
-
미해결따라하며 배우는 NestJS
[JWT를 이용해서 토큰 생성하기] secretOrPrivateKey must have a value 에러 발생
JWT를 이용해서 토큰 생성하기 강의중POST /sigin API에 요청을 보냈을 때 아래와 같은 에러가 발생합니다:ERROR [ExceptionsHandler] secretOrPrivatekey must have a value
-
미해결따라하며 배우는 NestJS
npm run start시 QueryFailedError: "username" 열의 자료 가운데 null 값이 있습니다. 에러가 발생합니다.
npm run start로 application을 실행시켰을 때QueryFailedError: "username" 열(해당 릴레이션 "user")의 자료 가운데 null 값이 있습니다에러가 발생합니다.DB 상태는 회원가입한 유저가 user 테이블에 존재합니다.
-
미해결Spring Boot JWT Tutorial
TokenProvider의 의존성 주입이 끝난 이후 key변수를 할당하는 이유
3강 1:58에서 TokenProvider에 대해 설명해주시면서빈 생성 이후 의존성 주입까지 받은 뒤 Key를 생성하기 위해 InitializingBean을 implement한다고 설명해주셨는데,서치를 하다 보니 강사님처럼 인터페이스 구현 없이 생성자에서 바로 Key를 생성하는 코드도 간혹 보았습니다.이처럼 생성자 호출 시에 Key를 만들지 않고 그 이후에 Key를 생성하신 구체적인 이유가 궁금합니다.
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
비대칭키 jwt 인증 문제
http://localhost:8888/ecommerce/default 에서는 {name: "ecommerce",profiles: ["default"],label: null,version: "f45bf692a6cb54252ea12041f0aa92a71964a5f7",state: null,propertySources: [{name: "file:///C:\\Users\\ydj90\\Downloads\\git/file:C:\Users\ydj90\Downloads\git\ecommerce.yml",source: {token.expiration_time: 864000000,gateway.ip: "172.30.1.33",token.secret: "userToken_token"}}]}http://localhost:8888/user-service/default 에서는{name: "user-service",profiles: ["default"],label: null,version: "f45bf692a6cb54252ea12041f0aa92a71964a5f7",state: null,propertySources: [{name: "file:///C:\\Users\\ydj90\\Downloads\\git/file:C:\Users\ydj90\Downloads\git\user-service.yml",source: {spring.datasource.url: "jdbc:h2:mem:testdb",spring.datasource.driver-class-name: "org.h2.Driver",spring.datasource.generate-unique-name: false,token.expiration_time: 864000000,gateway.ip: "172.30.1.33",order_service.url: "http://ORDER-SERVICE/order-service/%s/orders",spring.datasource.username: "sa",token.secret: "userToken_token"}}]} 이와 같이 token.secret이 같은데 왜 subject가 null값이 되는지 이유를 알 수 가 없습니다. login하고 나온 header값을 가지고 bearer에 넣어 인증하는 방식이 아닙니까?이유를 잘 모르겠습니다. JWT token is not valid이게 왜 뜨는지subject = Jwts.parser().setSigningKey(env.getProperty("token.secret")) .parseClaimsJws(jwt).getBody() .getSubject(); 여기서 왜 null값으로 값을 반환하는지 이해를 할 수가 없습니다.