묻고 답해요
130만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 영화 사이트 만들기
#2강 npm install
npm ERR! code 1 npm ERR! path C:\Users\지은\Downloads\boilerplate-mern-stack-master\boilerplate-mern-stack-master\node_modules\bcrypt npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build npm ERR! Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\지은\AppData\Roaming\nvm\v16.15.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\지은\Downloads\boilerplate-mern-stack-master\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\지은\Downloads\boilerplate-mern-stack-master\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1) npm ERR! node-pre-gyp info it worked if it ends with ok npm ERR! node-pre-gyp info using node-pre-gyp@0.14.0 npm ERR! node-pre-gyp info using node@16.15.0 | win32 | x64 npm ERR! node-pre-gyp WARN Using needle for node-pre-gyp https download npm ERR! node-pre-gyp info check checked for "C:\Users\지은\Downloads\boilerplate-mern-stack-master\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding\bcrypt_lib.node" (not found) npm ERR! node-pre-gyp http GET https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-win32-x64-unknown.tar.gz npm ERR! node-pre-gyp http 404 https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-win32-x64-unknown.tar.gz npm ERR! node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-win32-x64-unknown.tar.gz npm ERR! node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.8 and node@16.15.0 (node-v93 ABI, unknown) (falling back to source compile with node-gyp) npm ERR! node-pre-gyp http 404 status code downloading tarball https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-win32-x64-unknown.tar.gz npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@9.0.0 npm ERR! gyp info using node@16.15.0 | win32 | x64 npm ERR! gyp info ok npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@9.0.0 npm ERR! gyp info using node@16.15.0 | win32 | x64 npm ERR! gyp ERR! find Python npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON npm ERR! gyp ERR! find Python checking if "python3" can be used npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error npm ERR! gyp ERR! find Python checking if "python" can be used npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python39\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python39\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python39\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python39-32\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python39-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python39-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python39-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python39-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python38\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python38\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python38\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python38-32\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python38-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python38-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python38-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python38-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python37\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python37\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python37\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python37-32\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python37-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python37-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python37-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python37-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python36\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python36\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python36\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python36-32\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python36-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python36-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python36-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python36-32\python.exe" could not be run npm ERR! C:\Users\지은\AppData\Local\npm-cache\_logs\2022-05-25T05_57_34_949Z-debug-0.lognpm ERR! code 1 npm ERR! path C:\Users\지은\Downloads\boilerplate-mern-stack-master\boilerplate-mern-stack-master\node_modules\bcrypt npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build npm ERR! Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\지은\AppData\Roaming\nvm\v16.15.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\지은\Downloads\boilerplate-mern-stack-master\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\지은\Downloads\boilerplate-mern-stack-master\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1) npm ERR! node-pre-gyp info it worked if it ends with ok npm ERR! node-pre-gyp info using node-pre-gyp@0.14.0 npm ERR! node-pre-gyp info using node@16.15.0 | win32 | x64 npm ERR! node-pre-gyp WARN Using needle for node-pre-gyp https download npm ERR! node-pre-gyp info check checked for "C:\Users\지은\Downloads\boilerplate-mern-stack-master\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding\bcrypt_lib.node" (not found) npm ERR! node-pre-gyp http GET https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-win32-x64-unknown.tar.gz npm ERR! node-pre-gyp http 404 https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-win32-x64-unknown.tar.gz npm ERR! node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-win32-x64-unknown.tar.gz npm ERR! node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.8 and node@16.15.0 (node-v93 ABI, unknown) (falling back to source compile with node-gyp) npm ERR! node-pre-gyp http 404 status code downloading tarball https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-win32-x64-unknown.tar.gz npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@9.0.0 npm ERR! gyp info using node@16.15.0 | win32 | x64 npm ERR! gyp info ok npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@9.0.0 npm ERR! gyp info using node@16.15.0 | win32 | x64 npm ERR! gyp ERR! find Python npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON npm ERR! gyp ERR! find Python checking if "python3" can be used npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error npm ERR! gyp ERR! find Python checking if "python" can be used npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python39\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python39\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python39\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python39-32\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python39-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python39-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python39-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python39-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python38\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python38\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python38\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python38-32\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python38-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python38-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python38-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python38-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python37\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python37\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python37\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python37-32\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python37-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python37-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python37-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python37-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python36\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python36\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python36\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python36-32\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python36-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python36-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python36-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python36-32\python.exe" could not be run npm ERR! C:\Users\지은\AppData\Local\npm-cache\_logs\2022-05-25T05_57_34_949Z-debug-0.log 루트 디렉토리에서 npm install 오류가 계속뜹니다ㅠ 버전의 문제인가요...? 이 강의 꼭 듣고싶은데 해결방법이 있을까요..?
-
미해결따라하며 배우는 TDD 개발 [2023.11 업데이트]
mongodb project 및 cluster관련
안녕하세요! 강의 잘 듣고 있습니다. 크리티컬한 질문은 아닌데요! boiler-plate 때 project를 만들었었는데, tdd-app에도 project를 새로 만들었습니다. 강의와 같이 간단한 프로젝트들이라면 프로젝트를 새로 안만들고 안쪽의 dbname만 바꿔서 사용하는 느낌으로 가는건가요? uri에서 dbname을 바꾸는건? 어떤 의도로 사용되는건지 여쭤보고 싶습니다!
-
미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
파일을 클릭하면 제일 1번라인 import에 빨간줄 문의드립니다
안녕하세요 강사님 궁금하게 생겨 문의 드립니다. 다음 사진처럼 항상 파일을 클릭하면 상단 import줄이 저렇게 변하는데요 파일을 다시 닫으면 빨간줄이 사라집니다. 깃허브에 있는 tsconfig.json과 .eslintrc.js는 그대로 복붙했습니다. 제가놓친게있을까요?
-
해결됨탄탄한 백엔드 NestJS, 기초부터 심화까지
cats.module.ts에서 MongooseModule.forFeature 질문 드립니다
안녕하세요 강사님 cats.module.ts 파일에서 import: [MongooseModule.forFeature([{ name: Cat.name, schema: CatSchema }]),이부분에서 빨갛게 해논부분에 왜 Cat.name , name이 붙어있는 이유가 뭔지 알고싶습니다. 저기서 name에 할당한 값으로 Service에서 생성자 주입 받을때? Cat.name 으로 @InjectModel(Cat.name) 하는걸로 보이는데 왜 ".name" 이 붙은건가요?..
-
해결됨[리뉴얼] Node.js 교과서 - 기본부터 프로젝트 실습까지
마지막 쓰레드는 range를 따로 계산하신 이유가 있나요?
threads.add(new Worker(__filename, { workerData: { start, range: range + ((max - min + 1) % threadCount) } })); for문에서 threadCount - 1 안 하고 threadCount 까지 반복하면 안 되는 이유가 있는지 궁금합니다. 마지막에 따로 빼면 range가 10000007까지로 되는거 같아서요.
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 유튜브 사이트 만들기
import {Icon} 에러 나시는 분
직접 공식문서 찾아드리려 했지만 이분께서 정리를 잘 해주셨습니다. ant design업그레이드 되면서 바뀐 문제입니다. 참고: https://shinye0213.tistory.com/317
-
미해결MERN STACK 커뮤니티 : 시작부터 배포까지 알려주는 React
res.req.file로 코딩하시는 이유가 궁금합니다.
multer를 사용해서 하나의 파일만 받는 메소드인 upload를 사용하고 그 안에서 req, res, err 를 받아서 console.log(res.req.file)을 코딩하실 때, 설명으로는 upload의 응답인 res에 ImageUpload.js의 요청인 req라고 설명주시면서 res.req.file를 코딩하셨는데 req.file로 ImageUpload.js의 요청을 받아오는 것까지는 이해가 되었으나, res.req.file을 코딩하시는 것은 이해가 잘되지 않았습니다. 조금 더 추가적인 설명 부탁드립니다.
-
미해결mongoDB 기초부터 실무까지(feat. Node.js)
최신 faker 설치하지말고 구버전 설치하세요 ...
개발자가 최신버전 다 날리고 잠수탔다네요 ㅠ
-
미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
소셜 로그인 질문 (passport-apple)
저는 passport-jwt를 사용하여 로그인을 구현하였는데, 소셜 로그인을 위해 passport-apple 를 사용하여 유저 정보를 받아오려고하는데 막혔습니다. https://github.com/ananay/passport-apple/issues/30 nest.js에서 passport-apple사용시 Strategy 클래스의 validate함수에 인자가 제대로 들어오지않는 이슈가 있는것같습니다. 제가 유저정보를 받아온후 그것을 db에 저장후 jwt를 발행하여 다음요청부터는 애플을 거치지않고 제 서버로 jwt를 보내면 제가 유저정보 주는방식으로 구현하려고하는데, 유저 정보를 어떻게 받아와야하는지 모르겠습니다. 구글링해보니 idToken을 decode하면 유저정보가 들어있다고하는데, import { Injectable } from '@nestjs/common'; import { JwtService } from '@nestjs/jwt'; import { PassportStrategy } from '@nestjs/passport'; import { DecodedIdToken, Strategy, VerifyCallback } from 'passport-apple'; @Injectable() export class AppleStrategy extends PassportStrategy(Strategy, 'apple') { constructor(private jwtService: JwtService) { super({ clientID: process.env.APPLE_CLIENT_ID, teamID: process.env.APPLE_TEAM_ID, callbackURL: process.env.APPLE_CALLBACK_URL, keyID: process.env.APPLE_KEY_ID, privateKeyString: process.env.APPLE_KEY.replace(/\\n/g, '\n'), passReqToCallback: false, }); } async validate( accessToken: string, idToken: string, profile: any, done: VerifyCallback, ) { const decodedIdToken: DecodedIdToken = this.jwtService.verify(idToken); console.log(decodedIdToken); const user = { provider: 'apple', snsId: decodedIdToken.sub, password: decodedIdToken.sub, }; console.log(user); done(null, user); } } 이렇게 코드를 짜니 [Nest] 31 - 02/06/2022, 8:41:18 AM ERROR [ExceptionsHandler] jwt malformed JsonWebTokenError: jwt malformed at Object.module.exports [as verify] (/usr/src/app/node_modules/jsonwebtoken/verify.js:63:17) at JwtService.verify (/usr/src/app/node_modules/@nestjs/jwt/dist/jwt.service.js:37:20) at AppleStrategy.validate (/usr/src/app/src/auth/strategies/apple.strategy.ts:25:60) at AppleStrategy.<anonymous> (/usr/src/app/node_modules/@nestjs/passport/dist/passport/passport.strategy.js:20:55) at Generator.next (<anonymous>) at /usr/src/app/node_modules/@nestjs/passport/dist/passport/passport.strategy.js:8:71 at new Promise (<anonymous>) at __awaiter (/usr/src/app/node_modules/@nestjs/passport/dist/passport/passport.strategy.js:4:12) at AppleStrategy.callback [as _verify] (/usr/src/app/node_modules/@nestjs/passport/dist/passport/passport.strategy.js:17:45) at /usr/src/app/node_modules/passport-oauth2/lib/strategy.js:205:24 이러한 에러가 뜹니다. idToken을 어떻게 해독해야하는지 알수있을까요..? 혹시 실무에서 애플로그인 서비스를 구현해보셨다면 이방법말고 다른방법이라도 있다면 알려주시면 감사하겠습니다!
-
미해결MERN STACK 커뮤니티 : 시작부터 배포까지 알려주는 React
Post 챕터 Read (1) 강의에서 axios 안되시는 분들 정보 공유합니다
백단에서 post요청 then().catch() 설정한 후 클라이언트 List.js에서 axios로 /api/post/list 포스트 요청하고 콘솔창 확인해보면 400 에러가 뜨는데 일단 서버폴더 Model/Post.js에서 스키마 부분 Collection : "posts"로 바꾼 다음에 다시 새로고침 해보니깐 postList 데이터 콘솔창에 찍힙니다 초반강의 몽구스 설정할 때 collation : "posts"로 하셨는데 오타인지 궁급합니다!
-
해결됨[리뉴얼] Node.js 교과서 - 기본부터 프로젝트 실습까지
fs.readFile 호출시 readFile 도 background 로 보내는 건가요?
const fs = require('fs') fs.readFile('/Users/joe/test.txt', 'utf8' , (err, data) => { if (err) { console.error(err) return } console.log(data) }) 관련 질문을 읽다가 readFile 도 background 로 간다는 뉘앙스가 느껴져서 질문해봅니다. readFile 함수 자체는 background 로 가진 않지만 파일 읽는 행위가 background 에서 진행되는 걸까요?
-
미해결[리뉴얼] Node.js 교과서 - 기본부터 프로젝트 실습까지
몽고디비 연결 에러
안녕하세요, npm start를 눌러 실행하면 다음과 같은 오류가 뜹니다. 현재 mongo db 5.0.5버전을 사용하고 있습니다. 그 외 모듈의 버전은 실습과 동일하게 설정하였습니다. mongod --auth를 실행한 후 , mongo admin -u root -p 비밀번호를 입력한 후에 제대로 접속이 된 것을 확인하고 npm start를 하였습니다. 인터넷에서 오류를 검색하여 해결하고자 하였으나 해결하지 못하여 글을 올리게 되었습니다.ㅠㅠ 어떻게 해결하면 좋을지 알려주시면 감사하겠습니다.
-
미해결리액트로 나만의 블로그 만들기(MERN Stack)
몽고db 사이트가 많이 바뀌어서
몽고db 사이트가 많이바뀌어서 cluster 화면이 너무많이바뀌어서 강의를 알아들을수없습니다.
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 쇼핑몰 사이트 만들기[전체 리뉴얼]
heroku 배포후 master 브랜치에 push 할때마다 이미지가 날라가는거 해결방법이 있을까요??
배포한 앱에서 사진을 업로드하면 서버의 upload 폴더에 사진이 저장되어있을텐데 수정할 부분이 있어서 수정하고 다시 push 하면 서버의 upload 폴더가 local의 upload 폴더로 바뀌기 때문에 날라가는거 같은데 다시 push 했을때 서버가 가지고있는 이미지를 안날라가게 하는 방법이 있을까요?
-
미해결[리뉴얼] Node.js 교과서 - 기본부터 프로젝트 실습까지
.listen
강의에서 8번째 줄에 그냥 .listen이 이해가 가질 않습니다. 보통 .이면 메소드?를 불러오는건데 어떤놈의 메소드(함수)인지 궁금합니다
-
미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
안녕하세요 강사님 실행할때 오류가 발생해서 질문드립니다.
Error: Cannot find module 'app.model' Require stack: - D:\Study\Inflearn\NestJS\Express\letsStart\dist\app.js at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.<anonymous> (D:\Study\Inflearn\NestJS\Express\letsStart\dist\app.js:4:19) at Module._compile (node:internal/modules/cjs/loader:1101:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) { code: 'MODULE_NOT_FOUND', requireStack: [ 'D:\\Study\\Inflearn\\NestJS\\Express\\letsStart\\dist\\app.js' ] } npm run start:dev 했을때 이와같은 오류가 발생하고 postman도 마찬가지로 localhost:8000으로 get 검색시 찾지 못하는데 어느 부분에서 잘못됬는지를 모르겠습니다. 코드는 오타 없이 강사님이 작성한것과 동일합니다.
-
해결됨따라하며 배우는 노드, 리액트 시리즈 - 영화 사이트 만들기
더보기 버튼 클릭 시 경고메세지가 나옵니다.
안녕하세요? 더보기 버튼을 클릭하면 아래쪽으로 20개씩 영화 리스트가 쭉 뻗어나가는 기능은 정상적으로 작동합니다. 그런데 더보기를 누를 때마다 저런 경고메세지가 나옵니다. 다른분들 글을 보고 참고해서 MainMovieImage에 초기값으로 null을 넣어주었고, 선생님 코드와 비교해봐도 다른점이 없습니다. 그리고 저는 웹 페이지를 처음 로드했을 때는 아무런 에러가 없다가, loadMore 버튼만 누르면 이러는데..어떻게 해결해야 할까요 ㅠ
-
해결됨탄탄한 백엔드 NestJS, 기초부터 심화까지
TypeORM 트랜잭션 질문드립니다.
안녕하세요 윤상석 강사님. TypeORM의 트랜잭션 관련으로 질문이 있습니다.TypeORM에서 트랜잭션을 다루는 방법은 이전 질문글에 답변해주셨듯이 크게 3가지인 것으로 알고 있습니다.1. QueryRunner2. getConnection, getManager3. @Transactional개인적으로는 @Transactional() 데코레이터를 사용하는것이 편리하여 사용하고 있었는데요.NestJS 공식문서에서 데코레이터를 이용하는 것을 권장하지 않고 있고,구글링을 해보아도 유닛 테스트에 어려움이 있어 권장하지 않는 분들이 많은 것을 알게되었습니다.여기서 첫 번째 질문이 있습니다.Q1. "유닛 테스트에 어려움이 있다"는 이야기가 구체적으로 무슨 의미인지 궁금합니다. 모킹이 어렵다. 내 마음대로 제어가 불가능하다 등의 이야기가 이해는 가는데 와닿지는 않아서 질문드립니다.----QueryRunner 방식을 이용하게 되면 try-catch-finally 코드가 강제가 되는 것 같아보입니다.여기서 두 번째 질문이 있습니다.Q2. 모든 에러를 감지하는 Filter를 적용해두었다면 QueryRunner를 사용하는 try-catch-finally 구문에서 에러 처리를 해버려 필터가 작동하지 않을 것 같은데 맞을까요?맞다면, 만약 Filter에서 요청이 실패하였을 때의 로깅기능이 있다고 가정한다면 로깅기능이 작동하지 않을 것 같습니다.그렇다면 catch 문에서 따로 Filter에서 구현한 로깅을 다시 구현해주어야 할까요?----트랜잭션 처리를 도와주는 typeorm-transactional-cls-hooked 패키지를 발견하였습니다.여기서 마지막 세 번째 질문이 있습니다.Q3. 해당 패키지는 유닛 테스를 할 때 트랜잭션 기능이 작동하지 않도록 모킹기능도 제공해주는 것 같습니다. QuerryRunner 보다 안 좋은점이 있다면 어떤 점이 있을까요?----질문이 너무 많은 것 같아 죄송합니다.좋은 강의와 답변해주셔서 항상 감사합니다.
-
미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
useFactory 사용시 resource 파일 분리 후 di 방법
먼저 너무 좋은 ADMIN 대시보드 라이브러리를 알려주셔서 감사합니다. 해당 라이브러리로 몇가지 테스트해보는 중인데 adminJsOptions가 너무 길어져 resources를 별도의 파일로 분리하려 하고 있습니다. 하다보니 이미 factory로 blogModel을 inject하고 있는데 resources를 별도의 파일로 분리하려고 보니 blogModel을 분리한 파일에서 어떻게 가져와야할지 막막하더라구요. adminjs뿐아니라 다른 모듈을 사용할때도 useFactory를 통해 di를 해주는경우가 많은데 이럴때는 분리된 파일에는 어떻게 의존성을 주입해줘야 할까요??? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 import * as AdminJSMongoose from '@adminjs/mongoose'; import { AdminModule as AdminBroModule } from '@adminjs/nestjs'; import { Module } from '@nestjs/common'; import { getModelToken } from '@nestjs/mongoose'; import AdminJS from 'adminjs'; import { Model } from 'mongoose'; import { UsersModule } from 'src/users/users.module'; import { User } from 'src/users/users.schema'; import { after, before } from './hooks/users.hooks'; AdminJS.registerAdapter(AdminJSMongoose); @Module({ imports: [ AdminBroModule.createAdminAsync({ imports: [UsersModule], inject: [getModelToken(User.name)], useFactory: (usersModel: Model<User>) => ({ adminJsOptions: { rootPath: '/admin', resources: [ { resource: usersModel, options: { navigation: { name: null, icon: '', }, properties: { email: { isTitle: false, position: 1, }, name: { isTitle: true, }, _id: { isVisible: { list: false }, }, password: { isVisible: false, }, }, actions: { edit: { isAccessible: isAdmin }, delete: { isAccessible: isAdmin }, new: { isAccessible: isAdmin }, show: { isAccessible: isAdmin, }, list: { isAccessible: isAdmin }, custom_delete: { actionType: 'record', icon: 'TrashCan', guard: 'doYouReallyWantToDoThis', variant: 'danger', before: before, after: after, handler: async (request, response, context) => { const user = context.record; await usersModel.findOne({_id: request.params.id}); console.log('custom handler!!!'); return { record: user.toJSON(context.currentAdmin), }; } }, }, }, }, ], }, auth: { authenticate: async (email, password) => { const user = await usersModel.findOne({ email: email }); if (user) { const matched = user.password === password; if (matched && user.role === 'ADMIN') { return user.readOnlyData; } } return null; }, cookieName: 'cookie-test', cookiePassword: 'test', }, }), }), ], }) export class AdminModule {} const isAdmin = ({ currentAdmin }) => currentAdmin && currentAdmin.role === 'ADMIN'; resource 코드 분리 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 import * as AdminJSMongoose from '@adminjs/mongoose'; import { AdminModule as AdminBroModule } from '@adminjs/nestjs'; import { Module } from '@nestjs/common'; import { getModelToken } from '@nestjs/mongoose'; import AdminJS from 'adminjs'; import { Model } from 'mongoose'; import { UsersModule } from 'src/users/users.module'; import { User } from 'src/users/users.schema'; import { after, before } from './hooks/users.hooks'; import { userResource } from './resources/users.resource'; AdminJS.registerAdapter(AdminJSMongoose); @Module({ imports: [ AdminBroModule.createAdminAsync({ imports: [UsersModule], inject: [getModelToken(User.name)], useFactory: (usersModel: Model<User>) => ({ adminJsOptions: { rootPath: '/admin', resources: [ userResource ], }, auth: { authenticate: async (email, password) => { const user = await usersModel.findOne({ email: email }); if (user) { const matched = user.password === password; if (matched && user.role === 'ADMIN') { return user.readOnlyData; } } return null; }, cookieName: 'cookie-test', cookiePassword: 'test', }, }), }), ], }) export class AdminModule {} const isAdmin = ({ currentAdmin }) => currentAdmin && currentAdmin.role === 'ADMIN'; 함수로 만들어 파라미터로 넘겨주는 방법밖에 없을까요???
-
미해결[리뉴얼] Node.js 교과서 - 기본부터 프로젝트 실습까지
해당 코드를 실행했을때 어떤 문제점이 있을지 생각해보는 문제였습니다.. 어떤 문제가 발생할지 가늠이 안됩니다....
코드는 다음과 같습니다 해당 코드를받고 어떤 문제점이 생길 수 있는지 파악해보라 하셨는데... 모른채 넘어갔습니다. 혼자라도 알아보려고 노력했는데 잘 모르겠습니다. 도움을 주실 수 있을까요.. let number = 0; const times = 100; function sleep() { return new Promise((resolve) => setTimeout(resolve, Math.random() * 5)); } async function adder() { for (let i = 0; i < times; i++) { await sleep(); let read = number; read = read + 1; await sleep(); number = read; } } async function subber() { for (let i = 0; i < times; i++) { await sleep(); let read = number; read = read - 1; await sleep(); number = read; } } async function main() { console.log("Started with", number); await Promise.all([ adder(), subber(), ]); console.log("Ended with", number); } main() .then(() => console.log("All done")) .catch((err) => console.error(err));