inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

172만명의 커뮤니티!! 함께 토론해봐요.

퍼사드 패턴 코드 공유 드립니다!

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

퍼사드 패턴 관련하여 노션 코드는 강의 코드와 다르기때문에, 에러를 해결하지 못하신 분들을 위해서 코드 공유 드립니다. (에러메세지로 위치, 그 위치에 해당하는 강사님이 강의 진행시 적어주셨던 코드와 대조하여서 작성하였습니다) // index.js import { checkValidationPhone, getToken, sendTokenToSMS} from './phone.js' // requestAnimationFrame('./phone.js') console.log('안녕하세요~~'); function createTokenOfPhone(myphone) { // 1. 휴대폰번호 자릿수 맞는지 확인하기 const isValid = checkValidationPhone(myphone); if (isValid) { // 2. 핸드폰 토큰 6자리 만들기 const mytoken = getToken(); // 3. 핸드폰번호에 토큰 전송하기 sendTokenToSMS(myphone, mytoken); } } createTokenOfPhone('01012345678', 6); // phone.js export function checkValidationPhone(myphone) { if (myphone.length !== 10 && myphone.length !== 11) { console.log('에러 발생!!! 핸드폰 번호를 제대로 입력해 주세요!!!'); return false; } else { return true; } } export function getToken(count) { const mycount = 6 if (count === undefined|null) { console.log('에러 발생!!! 갯수를 제대로 입력해 주세요!!!'); return; } else if (mycount <= 0) { console.log('에러 발생!!! 갯수가 너무 적습니다!!!'); return; } else if (mycount > 10) { console.log('에러 발생!!! 갯수가 너무 많습니다!!!'); return; } const result = String(Math.floor(Math.random() * 10 ** count)).padStart(mycount,'0'); return result; // console.log(result) } export function sendTokenToSMS(fff, ggg) { console.log(fff + '번호로 인증번호' + ggg + '를 전송합니다!!'); }

  • rest-api
  • node.js
  • tdd
  • javascript
  • express
  • docker
  • nodejs
  • nestjs
  • NestJS
최다니엘 댓글 0 좋아요 4 조회수 503

yarn init 에러 문의

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

안녕하세요 선생님 퍼샤드 패턴에서 58분쯤 보면 yarn init이라고 입력을 하시던데 저의 경우에는 에러가 뜹니다. ERROR: init is not COMMAND nor fully qualified CLASSNAME. Usage: yarn [OPTIONS] SUBCOMMAND [SUBCOMMAND OPTIONS] or yarn [OPTIONS] CLASSNAME [CLASSNAME OPTIONS] 왜 입력 값이 충족되지 않았다고 하는 걸까요? 참고로 제 node.js 버전은 18대입니다. 혹시몰라 전체적인 에러메세지 같이 첨부합니다! (base) ➜ 01-05-token-count-api-facade-import git:(master) ✗ yarn init ERROR: init is not COMMAND nor fully qualified CLASSNAME. Usage: yarn [OPTIONS] SUBCOMMAND [SUBCOMMAND OPTIONS] or yarn [OPTIONS] CLASSNAME [CLASSNAME OPTIONS] where CLASSNAME is a user-provided Java class OPTIONS is none or any of: --buildpaths attempt to add class files from build tree --config dir Hadoop config directory --daemon (start|status|stop) operate on a daemon --debug turn on shell script debug mode --help usage information --hostnames list[,of,host,names] hosts to use in worker mode --hosts filename list of hosts to use in worker mode --loglevel level set the log4j level for this command --workers turn on worker mode SUBCOMMAND is one of: Admin Commands: daemonlog get/set the log level for each daemon node prints node report(s) rmadmin admin tools scmadmin SharedCacheManager admin tools Client Commands: applicationattempt prints applicationattempt(s) report app|application prints application(s) report/kill application/manage long running application classpath prints the class path needed to get the hadoop jar and the required libraries cluster prints cluster information container prints container(s) report envvars display computed Hadoop environment variables fs2cs converts Fair Scheduler configuration to Capacity Scheduler (EXPERIMENTAL) jar <jar> run a jar file logs dump container logs nodeattributes node attributes cli client queue prints queue information schedulerconf Updates scheduler configuration timelinereader run the timeline reader server top view cluster information version print the version Daemon Commands: nodemanager run a nodemanager on each worker proxyserver run the web app proxy server registrydns run the registry DNS server resourcemanager run the ResourceManager router run the Router daemon sharedcachemanager run the SharedCacheManager daemon timelineserver run the timeline server SUBCOMMAND may print help when invoked w/o parameters or with -h. 구글링은 해봐도 못찾겠고, 그나마 힌트가 될만한건 이전에 hadoop 설치하면서 yarn이 같이 깔렸던 것 같은데, 그것과 충돌이 되서 그럴 수 있다는 정보까진 찾았습니다! brew uninstall hadoop 으로 하둡을 날려버렸더니 yarn 명령이 아예 작동이 안되는 것으로 봐서는 맞는 것 같습니다. brew install yarn으로 설치 다시 해줬더니 작동은 잘 됩니다! 선생님 이럴경우에 삭제 말고 따로 하둡과 충돌할 경우에 hadoop의 yarn과 node.js의 yarn을 별도로 관리하는 방법은 없을까요?

  • node.js
  • javascript
  • nodejs
  • docker
  • express
  • rest-api
  • tdd
  • nestjs
  • NestJS
최다니엘 댓글 1 좋아요 0 조회수 863

[SOLVED] NestJS 프로젝트 생성 실패

미해결

탄탄한 백엔드 NestJS, 기초부터 심화까지

KT망을 사용 중일 경우 ts-jest가 설치되지 않는 문제가 있습니다. 해당 문제는 npm의 registry를 미러 서버로 설정한 뒤 nest new~ 를 통해 프로젝트를 생성하고, 다시 원 서버로 복구하시면 됩니다. npm config set registry https://registry.npmjs.cf/ nest new project npm config set registry https://registry.npmjs.org/ 안녕하세요 4번째 섹션의 첫 강의 NestJS 개발 환경 셋팅 을 보고 NestJS를 통한 Project를 생성하려 합니다. 사용중인 컴퓨터 환경은 다음과 같습니다. Apple Silicon M1 Max MacOS Ventura 13.2 Node: 16.16.0 Npm: 8.11.0 그런데 nest 문서에 나와있는 방법대로 프로젝트를 생성하면 에러가 발생합니다. > nest new project ⚡ We will scaffold your app in a few seconds.. ? Which package manager would you ❤️ to use? npm CREATE project/.eslintrc.js (663 bytes) CREATE project/.prettierrc (51 bytes) CREATE project/README.md (3340 bytes) CREATE project/nest-cli.json (171 bytes) CREATE project/package.json (1938 bytes) CREATE project/tsconfig.build.json (97 bytes) CREATE project/tsconfig.json (546 bytes) CREATE project/src/app.controller.spec.ts (617 bytes) CREATE project/src/app.controller.ts (274 bytes) CREATE project/src/app.module.ts (249 bytes) CREATE project/src/app.service.ts (142 bytes) CREATE project/src/main.ts (208 bytes) CREATE project/test/app.e2e-spec.ts (630 bytes) CREATE project/test/jest-e2e.json (183 bytes) ▹▹▹▹▸ Installation in progress... ☕ Failed to execute command: npm install --silent ✖ Installation in progress... ☕ 🙀 Packages installation failed! In case you don't see any errors above, consider manually running the failed command npm install to see more details on why it errored out. Thanks for installing Nest 🙏 Please consider donating to our open collective to help us maintain this package. 🍷 Donate: https://opencollective.com/nest 그래서 생성된 project 폴더로 이동하여 npm install --verbose를 통해 어디서 실패하는지 확인해 보았더니 다음과 같은 내용을 얻을 수 있었습니다. 로그가 너무 길어서, Error 부분만 넣겠습니다. npm timing idealTree:node_modules/windows-release/node_modules/execa Completed in 32ms npm http fetch GET 200 https://registry.npmjs.org/end-of-stream 28ms (cache revalidated) npm timing idealTree:node_modules/windows-release/node_modules/get-stream Completed in 28ms npm timing idealTree:node_modules/pump Completed in 1ms npm timing idealTree:node_modules/end-of-stream Completed in 0ms npm timing idealTree:node_modules/windows-release/node_modules/human-signals Completed in 0ms npm timing idealTree:node_modules/send/node_modules/debug/node_modules/ms Completed in 0ms npm timing idealTree:buildDeps Completed in 314816ms npm timing idealTree:fixDepFlags Completed in 3ms npm timing idealTree Completed in 314826ms npm timing command:install Completed in 314831ms npm verb type system npm verb stack FetchError: Invalid response body while trying to fetch https://registry.npmjs.org/ts-jest: aborted npm verb stack at ~/.nvm/versions/node/v16.16.0/lib/node_modules/npm/node_modules/minipass-fetch/lib/body.js:168:15 npm verb stack at runMicrotasks (<anonymous>) npm verb stack at processTicksAndRejections (node:internal/process/task_queues:96:5) npm verb stack at async RegistryFetcher.packument (~/.nvm/versions/node/v16.16.0/lib/node_modules/npm/node_modules/pacote/lib/registry.js:99:25) npm verb stack at async RegistryFetcher.manifest (~/.nvm/versions/node/v16.16.0/lib/node_modules/npm/node_modules/pacote/lib/registry.js:124:23) npm verb stack at async Arborist.[nodeFromEdge] (~/.nvm/versions/node/v16.16.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1108:19) npm verb stack at async Arborist.[buildDepStep] (~/.nvm/versions/node/v16.16.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:976:11) npm verb stack at async Arborist.buildIdealTree (~/.nvm/versions/node/v16.16.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:218:7) npm verb stack at async Promise.all (index 1) npm verb stack at async Arborist.reify (~/.nvm/versions/node/v16.16.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:153:5) npm verb cwd ~/Playground/nodejs/inflearn/nestjs/section4/project npm verb Darwin 22.3.0 npm verb node v16.16.0 npm verb npm v8.11.0 npm ERR! code ECONNRESET npm ERR! errno ECONNRESET npm ERR! network Invalid response body while trying to fetch https://registry.npmjs.org/ts-jest: aborted npm ERR! network This is a problem related to network connectivity. npm ERR! network In most cases you are behind a proxy or have bad network settings. npm ERR! network npm ERR! network If you are behind a proxy, please make sure that the npm ERR! network 'proxy' config is set properly. See: 'npm help config' npm verb exit 1 npm timing npm Completed in 314906ms npm verb unfinished npm timer reify 1676004665919 npm verb unfinished npm timer reify:loadTrees 1676004665923 npm verb code 1 npm ERR! A complete log of this run can be found in: npm ERR! ~/.npm/_logs/2023-02-10T04_51_05_846Z-debug-0.log NestJS에서 supertest 설치를 위해 jest 패키지를 설치하는 것 같은데, jest 패키지들이 정상적으로 (로그에 의하면 ts-jest) 설치되지 않습니다. 같은 에러를 겪은적 있으시거나, 해결법 아시는 분 도움 부탁드립니다. 감사합니다.

  • node.js
  • nestjs
  • nodejs
  • express
  • mongodb
  • NestJS
  • ssr
말하는 감자 댓글 3 좋아요 0 조회수 4991

강의자료 다운로드 관련

미해결

따라하며 배우는 NestJS

안녕하세요! 강의 잘 듣고 있는 수강생입니다. 강의자료 다운 받으면 pdf, xml 모두 폴더가 비어 있습니다. (DS_store 파일만 있어서요..) 혹시 제가 모르는 부분이 있으면 알려주시면 감사하겠습니다!

  • postgresql
  • jwt
  • nestjs
  • NestJS
  • typeorm
  • TypeORM
pluler 댓글 1 좋아요 0 조회수 579

동적배열 8:23

미해결

코딩테스트 [ ALL IN ONE ]

안녕하세요. 그림부분에서 이해가 가지않아 질문 드립니다. a =[1,2,3] 으로 초기화를하면 array는 0,1,2 즉 배열 그림이 3칸([][][])만 있어야 하는게 아닌가요? 하지만 강의의 그림에서는 [1][2][3][][] 으로 0,1,2,3,4 까지 그려져 있습니다. (size가 3인데 말이죠) a.append(4) 를 했을때, 동적배열은 array로 구현이 돼어있기때문에 random access 가 가능하여 마지막 index를 찾을 수 있다고 하셨는데, 선언및 초기화 a = [1,2,3] // 그림 -> [1][2][3] 접근 a[0] // O(1) 수정 a[1] = 9 // 그림 [1],[9],[3] 추가 a.append(4) // 이때 Resizing 이 일어나 /* 그림 [1][9][3] // 값을 옮긴 후 삭제 [1][9][3][4][][] // 복잡도 O(n) */ 의 모양이 돼야하는게 아닌가요? 즉, 궁굼한 점은 선언 및 초기화 할때 배열의 size 는 3인데그림의 배열 size는 [][][][][] 5칸이냐는 것입니다.

  • 알고리즘
  • python
  • 코테 준비 같이 해요!
  • algorithm
아요 댓글 1 좋아요 1 조회수 382

module imports로 주입 vs providers로 주입

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

위의 두개의 사진처럼 UserService를 바로 providers로 넣는 것과, UserModule에서 Service를 export 한 후 모듈 자체를 import 하는 것의 차이점과 어떤 경우에 두가지 방식을 구분하여 사용하는지 궁금합니다.

  • nestjs
  • javascript
  • express
  • tdd
  • rest-api
  • nodejs
  • docker
  • NestJS
제리제리 댓글 1 좋아요 1 조회수 411

console.log 실행불가

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

package.json 파일까지 추가해서 해봤는데도 실행이 안되네요 해결방법 알고싶습니다

  • rest-api
  • node.js
  • express
  • docker
  • javascript
  • nodejs
  • nestjs
  • tdd
  • NestJS
rina0930 댓글 1 좋아요 0 조회수 346

iframe src 흰화면

미해결

파이썬으로 영화 예매 오픈 알리미 만들기

링크를 복사하면 흰화면만 보이는데 이 경우에는 어떻게 해야하나요?

  • python
조윤희(풀스택 2회차) 댓글 0 좋아요 7 조회수 1011

TypeOrm @CreateDateColumn() 질문

미해결

Slack 클론 코딩[백엔드 with NestJS + TypeORM]

DB에 Insert 하려고 할 때 TypeOrm에서 Default 값을 넣어주지 않아 에러가 발생했습니다. (CreatedAt, UpdatedAt 컬럼) 그래서 처음에는 Database에서 Table에 Default값을 세팅하고 사용했는데요. 어떤 분이 질문 하신걸 보고 다시 수정해 보는 중입니다. 강의에 있는 소스는 @Column("datetime", { name: "createdAt", default: () => "CURRENT_TIMESTAMP"}) ... 이렇게 적혀있더군요. 근데 Github의 소스에는 @CreateDateColumn() createdAt: Data; 로만 적혀있었습니다. 그리고 @CreatedDateColumn()은 Special Column이라고 아래와 같이 설명이 있던데요. @CreateDateColumn is a special column that is automatically set to the entity's insertion date. You don't need to set this column - it will be automatically set. 저는 이 얘기를 TypeOrm에서 자동으로 입력해 주는 값으로 이해했는데... 막상 해보면 안되더라고요. 그래서... 만약 Github의 소스와 같이 @CreateDateColumn... 으로 사용하려면 Database에서 Default값을 설정해주어야 하는지 (그렇다면 @CreateDateColumn..은 자동 세팅되는 것이 아니겠죠...) 아니면 영상 강의 상처럼... default() => "CURRENT_TIMESTAMPT"... 로 사용해야 할지요 (물론 영상 강의의 소스는 Database에 그렇게 설정되어 있으니 그렇게 나온것이겠지만요..)

  • node.js
  • TypeORM
  • nestjs
  • NestJS
  • nodejs
  • typeorm
  • express
yisi 댓글 1 좋아요 0 조회수 2575

안녕하세요. jest관련해서 질문드립니다.

미해결

Slack 클론 코딩[백엔드 with NestJS + TypeORM]

현재 강의에 목업으로 된 테스트 코드가 작성되어져 있는걸 봤는데요 실제 DB에다가 테스트를 하려고 이것저것 해봤는데 잘 안되더라구요;; error: Nest can't resolve dependencies of the ~~ 하면서 에러가 나오고 아마 서비스 쪽에 주입된 레파지토리 때문일 것 같은데 목업이 아닌 실제 db에 테스트코드를 돌리기 위해서는 어떤 작업이 필요한 지 질문드립니다.

  • node.js
  • TypeORM
  • nestjs
  • NestJS
  • express
  • typeorm
  • nodejs
이길13111 댓글 1 좋아요 0 조회수 375

npm i vs npm add

미해결

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

현재 Swagger를 활용한 API-Docs 생성 수강중 입니다. 21분 36초에 npm add 로 설치하는데 npm i 와 npm add 의 차이를 앞부분에서 설명해 주셨을까요? 기억이 왜 안날까요?

  • express
  • node.js
  • javascript
  • tdd
  • nodejs
  • rest-api
  • nestjs
  • docker
  • NestJS
김주원 댓글 3 좋아요 0 조회수 2363

25-04 pointTransaction.service.ts 에러

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

// 2. 유저의 돈 찾아오기 // const user = await this.userRepository.findOne({ // where: { id: currentUser.id }, // }); const user = await queryRunner.manager.findOne( User, { id: currentUser.id }, { lock: { mode: "pessimistic_write" } }, ); 위의 코드에서 { lock: { mode: "pessimistic_write" } }, 부분이 추가되면서 아래의 에러가 발생하고 있습니다. src/apis/pointTransaction/pointTransaction.service.ts:52:9 - error TS2554: Expected 2 arguments, but got 3. 52 { lock: { mode: "pessimistic_write" } }, 테스트를 진행해보려면 어떻게 코드 수정이 되어야 할런지요?

  • docker
  • node.js
  • tdd
  • javascript
  • rest-api
  • express
  • nodejs
  • nestjs
  • NestJS
dreaminliner 댓글 2 좋아요 0 조회수 685

logger.middleware.ts 가 app.module에 적용이 되질않아서 질문드립니다.

미해결

Slack 클론 코딩[백엔드 with NestJS + TypeORM]

제목과 동일한 내용으로 logger middleware를 작성하고 app module에 적용하였습니다. 그리고 재시작을 하여 적용 여부를 확인하려 했으나 적용이 되지않은것을 확인했습니다. 어떤부분을 놓치고 있는지 알고싶습니다. package.json { "name": "a-nest", "version": "0.0.1", "description": "", "author": "", "private": true, "license": "UNLICENSED", "scripts": { "prebuild": "rimraf dist", "build": "nest build", "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", "start": "nest start", "start:dev-backup": "nest start --watch", "start:dev": "nest build --webpack --webpackPath webpack-hmr.config.js --watch", "start:debug": "nest start --debug --watch", "start:prod": "node dist/main", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", "test": "jest", "test:watch": "jest --watch", "test:cov": "jest --coverage", "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", "test:e2e": "jest --config ./test/jest-e2e.json" }, "dependencies": { "@nestjs/common": "^9.0.0", "@nestjs/config": "^2.3.0", "@nestjs/core": "^9.0.0", "@nestjs/platform-express": "^9.0.0", "axios": "^1.3.2", "reflect-metadata": "^0.1.13", "rimraf": "^3.0.2", "rxjs": "^7.2.0" }, "devDependencies": { "@nestjs/cli": "^9.0.0", "@nestjs/schematics": "^9.0.0", "@nestjs/testing": "^9.0.0", "@types/express": "^4.17.13", "@types/jest": "28.1.8", "@types/node": "^16.0.0", "@types/supertest": "^2.0.11", "@typescript-eslint/eslint-plugin": "^5.0.0", "@typescript-eslint/parser": "^5.0.0", "eslint": "^8.0.1", "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^4.0.0", "jest": "28.1.3", "prettier": "^2.3.2", "run-script-webpack-plugin": "^0.1.1", "source-map-support": "^0.5.20", "supertest": "^6.1.3", "ts-jest": "28.0.8", "ts-loader": "^9.2.3", "ts-node": "^10.0.0", "tsconfig-paths": "4.1.0", "typescript": "^4.7.4", "webpack": "^5.75.0", "webpack-node-externals": "^3.0.0" }, "jest": { "moduleFileExtensions": [ "js", "json", "ts" ], "rootDir": "src", "testRegex": ".*\\.spec\\.ts$", "transform": { "^.+\\.(t|j)s$": "ts-jest" }, "collectCoverageFrom": [ "**/*.(t|j)s" ], "coverageDirectory": "../coverage", "testEnvironment": "node" } } logger.middleware.ts import { Injectable, Logger, NestMiddleware } from '@nestjs/common'; import { NextFunction, Request, Response, response } from 'express'; @Injectable() export class LoggerMiddleware implements NestMiddleware { private logger = new Logger('HTTP'); use(req: Request, res: Response, next: NextFunction): void { const { ip, method, originalUrl } = req; const userAgent = req.get('user-agent') || ''; response.on('finish', () => { const { statusCode } = res; const contentLength = res.get('content-type'); this.logger.log( `${method} ${originalUrl} ${statusCode} ${contentLength} - ${userAgent} ${ip}`, ); }); next(); } } app.module.ts import { MiddlewareConsumer, Module, NestModule, RequestMethod, } from '@nestjs/common'; import { AppController } from './app.controller'; import { AppService } from './app.service'; import { ConfigModule, ConfigService } from '@nestjs/config'; import axios from 'axios'; import { LoggerMiddleware } from './middleware/logger.middleware'; const getEnv = async () => { // const response = await axios.get('비밀키를 요청하는 url'); // return response.data; }; const mode = process.env.NODE_ENV || 'development'; @Module({ imports: [ ConfigModule.forRoot({ isGlobal: true, load: [getEnv], envFilePath: `.env.${mode}`, }), ], controllers: [AppController], providers: [AppService, ConfigService], }) export class AppModule implements NestModule { configure(consumer: MiddlewareConsumer): any { consumer .apply(LoggerMiddleware) .forRoutes({ path: '*', method: RequestMethod.ALL }); } } nestjs log Info Webpack is building your sources... Entrypoint main 47.9 KiB = main.js 46.1 KiB 0.5051cca5f9ad96919687.hot-update.js 1.81 KiB webpack 5.75.0 compiled successfully in 63 ms [Nest] 36670 - 02/07/2023, 7:47:49 AM LOG [NestFactory] Starting Nest application... +6659ms [HMR] Updated modules: [HMR] - 10 [HMR] - 5 [HMR] - 3 [HMR] Update applied. [Nest] 36670 - 02/07/2023, 7:47:49 AM LOG [InstanceLoader] ConfigHostModule dependencies initialized +4ms [Nest] 36670 - 02/07/2023, 7:47:49 AM LOG [InstanceLoader] ConfigModule dependencies initialized +0ms [Nest] 36670 - 02/07/2023, 7:47:49 AM LOG [InstanceLoader] AppModule dependencies initialized +0ms [Nest] 36670 - 02/07/2023, 7:47:49 AM LOG [RoutesResolver] AppController {/}: +0ms [Nest] 36670 - 02/07/2023, 7:47:49 AM LOG [RouterExplorer] Mapped {/, GET} route +1ms [Nest] 36670 - 02/07/2023, 7:47:49 AM LOG [NestApplication] Nest application successfully started +0ms 적용이 되지않아 생기는 질문이라 에러코드는 없어서 따로 첨부하지 않았습니다.

  • node.js
  • express
  • nodejs
  • nestjs
  • typeorm
  • TypeORM
  • NestJS
양진영 댓글 2 좋아요 0 조회수 528

워크벤치 포트번호

해결됨

탄탄한 백엔드 NestJS, 기초부터 심화까지

워크벤치에, 전에 테스트해 보던게 있었습니다. 포트번호를 겹치지 않게 하려고 다르게 작성하니 OpenConnection 할 때 워크벤치가 그냥 꺼지는데요 포트번호는 항상 같아야 하는 건가요??

  • node.js
  • ssr
  • NestJS
  • nestjs
  • nodejs
  • ssr
  • express
  • mongodb
게으른 개발자 댓글 1 좋아요 0 조회수 529

@nestjs/core의 import 문제

미해결

Slack 클론 코딩[백엔드 with NestJS + TypeORM]

우선 잘 되는것이 갑자기 안되는데 해결이 안되서 질문을 올립니다. 우선 제가 한 작업은 다음과 같습니다. 7강의 typeorm 커넥션 맺기까지 완료 한 후 nest g res {service name}을 실행하여 테스트 했습니다 폴더가 생기면서 service, module, controller가 생기는것을 확인 한 후 삭제했습니다. 이후 yarn start:dev를 실행하면 아래와 같이 에러가 났습니다. yarn run v1.22.19 warning ..\package.json: No license field $ nest build --webpack --webpackPath webpack-hmr.config.js --watch Info Webpack is building your sources... ERROR in ./src/main.ts:1:29 TS2307: Cannot find module '@nestjs/core' or its corresponding type declarations. > 1 | import { NestFactory } from '@nestjs/core'; | ^^^^^^^^^^^^^^ 2 | import { DocumentBuilder } from '@nestjs/swagger'; 3 | import { SwaggerModule } from '@nestjs/swagger/dist'; 4 | import { AppModule } from './app.module'; webpack 5.75.0 compiled with 1 error in 3426 ms E:\web-message\dist\main.js:1834 /******/ throw e; ^ Error: Cannot find module '@nestjs/core' Require stack: - E:\web-message\dist\main.js at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15) at Module._load (node:internal/modules/cjs/loader:885:27) at Module.require (node:internal/modules/cjs/loader:1105:19) at require (node:internal/modules/cjs/helpers:103:18) at Object.<anonymous> (E:\web-message\dist\main.js:196:18) at __webpack_require__ (E:\web-message\dist\main.js:1831:33) at fn (E:\web-message\dist\main.js:1938:21) at Object.<anonymous> (E:\web-message\dist\main.js:166:16) at __webpack_require__ (E:\web-message\dist\main.js:1831:33) at E:\web-message\dist\main.js:2757:37 { code: 'MODULE_NOT_FOUND', requireStack: [ 'E:\\web-message\\dist\\main.js' ] } Node.js v18.13.0 우선 warning ..\package.json: No license field 이 부분을 해결하기 위해 찾아보니.. package.json의 private: true를 설정해 주라고 했지만, 이미 되어 있기 때문에 해결을 못했습니다. 그 다음 ERROR in ./src/main.ts:1:29 TS2307: Cannot find module '@nestjs/core' or its corresponding type declarations. > 1 | import { NestFactory } from '@nestjs/core'; 이 부분을 해결해 보기 위해 다음과 같은 작업을 했습니다. @nestjs/core의 삭제 및 재설치 node_modules 폴더 삭제 및 재설치 nestjs/core와 swagger의 충돌 문제가 있다는 얘기에 nestjs/core를 9.0.0으로 nestjs/common을 9.0.0으로, nestjs/platform-express를 9.0.0으로 수정하여 재설치 했으나 여전히 동일한 문제 발생 아래는 현재 저의 package.json입니다 { "name": "web-message", "version": "0.0.1", "private": true, "description": "", "author": "", "license": "UNLICENSED", "scripts": { "build": "nest build", "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", "start": "nest start", "start:dev-backup": "nest start --watch", "start:dev": "nest build --webpack --webpackPath webpack-hmr.config.js --watch", "start:debug": "nest start --debug --watch", "start:prod": "node dist/main", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", "test": "jest", "test:watch": "jest --watch", "test:cov": "jest --coverage", "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", "test:e2e": "jest --config ./test/jest-e2e.json" }, "dependencies": { "@nestjs/common": "^9.3.2", "@nestjs/config": "^2.3.0", "@nestjs/core": "^9.3.2", "@nestjs/platform-express": "^9.0.0", "@nestjs/swagger": "^6.1.4", "@nestjs/typeorm": "^9.0.1", "mariadb": "^3.0.2", "reflect-metadata": "^0.1.13", "rxjs": "^7.2.0", "swagger-ui-express": "^4.6.0", "typeorm": "^0.3.11", "typeorm-extension": "^2.4.2" }, "devDependencies": { "@nestjs/cli": "^9.0.0", "@nestjs/schematics": "^9.0.0", "@nestjs/testing": "^9.0.0", "@types/express": "^4.17.13", "@types/jest": "29.2.4", "@types/node": "18.11.18", "@types/supertest": "^2.0.11", "@typescript-eslint/eslint-plugin": "^5.0.0", "@typescript-eslint/parser": "^5.0.0", "eslint": "^8.0.1", "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^4.0.0", "jest": "29.3.1", "prettier": "^2.3.2", "run-script-webpack-plugin": "^0.1.1", "source-map-support": "^0.5.20", "supertest": "^6.1.3", "ts-jest": "29.0.3", "ts-loader": "^9.2.3", "ts-node": "^10.0.0", "tsconfig-paths": "4.1.1", "typeorm-model-generator": "^0.4.6", "typescript": "^4.7.4", "webpack": "^5.75.0", "webpack-cli": "^5.0.1", "webpack-node-externals": "^3.0.0", "webpack-pnp-externals": "^1.1.0" }, "jest": { "moduleFileExtensions": [ "js", "json", "ts" ], "rootDir": "src", "testRegex": ".*\\.spec\\.ts$", "transform": { "^.+\\.(t|j)s$": "ts-jest" }, "collectCoverageFrom": [ "**/*.(t|j)s" ], "coverageDirectory": "../coverage", "testEnvironment": "node" } } 뭔가... 업데이트를 하면서 문제가 생긴것 같아 찾던 중 nestjs@core와 swagger는 상호 작용하는 버전이 있다고 하던데 그것은 nest 9.X 미만에서 그런 것이고 github에 올려주신 package.json에도 9.X이상의 nestjs를 쓰신것으로 확인하여 swagger와의 충돌 문제는 아닌 것으로 생각했습니다. 어떻게 해결하면 좋을까요~? 참 참고로 nestjs : 9.1.8 yarn: 1.22.19 node: 18.13.0 을 사용하고 있습니다.

  • node.js
  • NestJS
  • TypeORM
  • nestjs
  • typeorm
  • express
  • nodejs
yisi 댓글 1 좋아요 0 조회수 2197

패턴으로 실습하며 익히기:html/css 이해를 바탕으로 크롤링하기

미해결

[리뉴얼] 파이썬입문과 크롤링기초 부트캠프 [파이썬, 웹, 데이터 이해 기본까지] (업데이트)

- 본 강의 영상 학습 관련 문의에 대해 답변을 드립니다. (어떤 챕터 몇분 몇초를 꼭 기재부탁드립니다) - 이외의 문의등은 평생강의이므로 양해를 부탁드립니다 - 현업과 병행하는 관계로 주말/휴가 제외 최대한 3일내로 답변을 드리려 노력하고 있습니다 - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. <div class="layer_body" data-translation="true"> <p>금융당국이 급증하는 가계부채 증가세를 막기 위해 아파트 잔금대출에도 소득을 따져 대출한도를 정하는 총부채상환비율(DTI)을 적용하는 방안을 유력하게 검토하고 있다.</p> <p>지금은 집값을 기준으로 대출한도를 매기는 주택담보인정비율(LTV) 규제만 적용돼 소득이 없어도 집값의 70%를 빌려 잔금을 치르는 게 가능하다.</p> <p>앞으로 잔금대출에 DTI가 적용되면 소득이 없는 사람은 집값의 70% 대출 받는 게 어려워진다.</p> </div> 안녕하세요. 지금 강의 중인 내용에 보면 class의 div 값과 다르게 2개의 값이 연이어 나오는데요. 이런 경우에는 어떻게 입력하면 될까요? 복사해서 넣어보고 했는데 계속 오류가 뜹니다. import requests from bs4 import BeautifulSoup res = requests.get(' https://v.daum.net/v/20170615203441266 ') soup = BeautifulSoup(res.content,'html.parser') mydata = soup.find_all('div','layer_body' data-translation='true') mydata.get_text() 이런식으로 연달아서 넣으면 되는건지... 답변 부탁드려요^^

  • python
  • 웹-크롤링
  • 웹-크롤링
테디베어123 댓글 2 좋아요 0 조회수 622

분류 결정 임곗값이 너무 낮아질 경우

미해결

[개정판] 파이썬 머신러닝 완벽 가이드

안녕하세요 강의 잘 듣고 있습니다! 분류결정 임곗값에 대해서 강의를 들을땐 잘 이해가 됐었는데 복습하면서 정리하다보니 제가 잘 이해가 안되는 부분이 있어 질문드립니다. 예를 들어, 분류 결정 임곗값이 0.3까지 낮아졌다고 할 때 pred_proba array에서 [0.49, 0.51] 이런 식으로 나온 경우 결국 0이나, 1이나 둘 다 임곗값은 넘었는데 어떤 걸로 예측하나요? 임곗값을 0.5로 설정했을땐 이럴 일이 없겠지만 임곗값을 낮췄을 때 어떻게 분류가 되는지 궁금합니다. 확률 간의 비교를 해서 더 높은 확률로 분류를 하는지 아니면 단순히 둘 다 넘었을 땐 positive로 분류하는 건지 알고싶습니다! 감사합니다.

  • python
  • 머신러닝
  • 통계
  • 통계
  • 머신러닝 배워볼래요?
minglet 댓글 1 좋아요 1 조회수 319

Notion 공유 요청을 보냈는데 오지 않았어요.

미해결

코딩테스트 [ ALL IN ONE ]

개발자 취업 비밀노트는 제대로 왔는데 코딩테스트 강의는 공유가 오지 않네요... 제 아아디와 이메일은 아이디 : SecondPhantom 이메일은 second2phatom@gmail.com 입니다.

  • python
  • algorithm
  • 코테 준비 같이 해요!
댓글 1 좋아요 1 조회수 517

노션과제에 대한 질문있습니다

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

혹시 과제 풀이를 볼수 있는곳이 있을까요?

  • node.js
  • nodejs
  • tdd
  • javascript
  • docker
  • express
  • rest-api
  • nestjs
  • NestJS
gogo 댓글 1 좋아요 2 조회수 501

Cannot set headers after they are sent to the client

미해결

탄탄한 백엔드 NestJS, 기초부터 심화까지

Cannot set headers after they are sent to the client에러를 구글링해보니 중복처리할 경우 발생한다하던데 이게 뭔 말인지도 잘 모르겠고 코드도 똑같이 따라쳤는데..ㅜㅜ 도와주세요 어떻게 해결해야할까요..몇시간째 붙잡고 있어요

  • node.js
  • express
  • mongodb
  • nestjs
  • nodejs
  • ssr
  • NestJS
tjwlgus35 댓글 1 좋아요 0 조회수 2028

인기 태그

인프런 TOP Writers

주간 인기글