묻고 답해요
161만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결Node.js의 모든 것
create( ) - User 를 만들기 수업 관련
강의 잘듣고 있는데 제가 아직 초보라서 강의를 듣고 게시판이나 로그인 같은것들을 잘 구현할수 있을지 nest js 와 잘 연동할수 있을지 감이 안잡혀서요 혹시 prisma 강의에서 로그인, 로그아웃 게시판 만들기 이미지 업로드 구현 같은 구체적인 기능 구현 강의는 추가 안되나요?
-
미해결Node.js의 모든 것
prisma 설정하고 미들웨어 사용해보기 강의 관련 질문들
질문1prisma 설정하고 미들웨어 사용해보기까지의 schema.prisma 코드가 있으신가요? 질문2그리고 prisma.push 하면 schema.prisma 에 모델로 설정되어 있는 것들만 스키마의 테이블로 등록 되는건가요? 혹시 없는 테이블들이 pgadmin 에서 미리 만들어져 있을 경우 어떻게 되나요? prisma.push 만 사용하면 장고처럼 migrations migrate 따로 관리 안해도 되나요? 질문3프리즈마 서비스 생성자 함수에 다음과 같이 설정하면 프리즈마 쿼리와 에러 정보를 확인 할수 있다 그렇게 생각하면 되나요? 그리고 그게 미들웨어 방식으로 설정하는 거죠?질문4아래 코드에서 params 는 백엔드에서 orm 으로 넘기는 파라미터 정보 next 는 디비로부터 오는 정보가 맞나요? 그리고 이 미들웨어는 자동으로 실행되는건가요? return 값은 어디로 가나요?
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
소셜로그인 43:30
제 본인 프로젝트에 해당되는 내용입니다.구글인증까지는 무난하게 되는데요.1. 파란색이 Entity() 에서 뽑아온 Column명에 해당하는 변수로 알고 있습니다. 2. 구글인증을 통과한 후에 name, email, password를 req.user로 넣어서 보내주는 걸로 알고 있습니다. <질문의도>name, email, password를 req.user객체에 넣어서 받았으니, req.user.name,req.user.email,req.user.password,데이터를 꺼내서 개별적으로컬럼에 저장되는 변수에userName = req.user.nameuserEmail = req.user.emailuserPassword = req.user.password위와 같이 저장되어야 하지 않아 생각해 봅니다. 그런데 아래 오류메시지의 경우<property 'email' does not exist on type 'User & Pick<User, userEmail, userName, userPassword>↑왜(why) req.user에서 userEmail, userName,userPassword를 찾고 있는지 이해가 가지 않습니다.----------------------------------------------------------제가 지금 머릿속에서 뭔가 꼬인 것 같습니다.답변 부탁드릴께요.진도를 못나가고 있어요ㅠ
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
N:N 구현 시, update 부분에서 컴파일 에러가 납니다.
async update({ productId: id, updateProductInput }: { productId: string, updateProductInput: UpdateProductInput }) { const beforeProduct = await this.findOne(id); const updatedProduct = { ...beforeProduct, id, //덮어쓰기 ...updateProductInput, // 덮어쓰기 }; return await this.productRepository.save(updatedProduct); } 위는 코드부입니다.일단 영상에서 update부분을 만진거 같지는 않은데, 여기서 updateProductInput의 productTags가 string 타입 배열이라 저장 시 충돌이 일어나네요. 태그 생성부분을 따로 메서드 추출을 해야할까요?
-
해결됨탄탄한 백엔드 NestJS, 기초부터 심화까지
좋지 않은 예 에서 import
테스트를 잠깐 해 보았는데요.다른 모듈에있는 Service를 사용하기 위해서는 (지금까지 배운 내용에 한해서)1. B Module 에 A Module , A Service 등록하기. 2. B Module 에 A Service 만 등록하기 3. A Module 에서 A Service 를 exports 에 등록하고, B Module에서는 A Module 을 등록하기 정도 생각이 들었고 테스트 해 보았습니다.강사님꼐서는 1번과 3번을 예시로 들어주셨는데요, 좋지않은 예시(1번) 에서CatsModule 까지 import 한 이유가 있을까요? AppModule에 CatsModule을 import 하지 않고, CatsService 만 providers 에 등록해 준 것과 다른가요? 아니면, 2번 에서 암시적으로 A Module이 import된다거나 하는게 있는건가요? ++ 인스턴스 가 새로 생성되는 것이라면, 서버사이드에서 는 굳이 싱글톤이 아니어도 될 인스턴스 객체들이 많을 것이라 보이는데, 다른 이유가 있나요?
-
미해결Slack 클론 코딩[백엔드 with NestJS + TypeORM]
mysql 설치는 윈도우에 대해서만 해주는 것인가요?
해당 강좌는 윈도우 기반인가요?설치에 대해서 윈도우만 설명하고 있어서 글을 적어보았습니다.
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
Entity 구현 - 1: N, N : M 이 강의10분 13초에서
안녕하세요.위 파일은 product.entity.ts 파일입니다.product.entity.ts 파일에서 @JoinColumn() 을 productSaleslocation 테이블에만 해주시는 이유가 무엇인지 알 수 있을까요?product테이블과 서로 관계를 맺고 있는 productSaleslocation 테이블과 users 테이블에도 @JoinColumn()을 해줘야 하는 것 아닌가요?상품테이블은productCategory테이블과(상품카테고리_id)ManyToOne 관계를 맺고 있으며, User 테이블과 (유저_id) ManyToOne 관계를 맺고 있어서 각각 JoinColumn을 해줘야 하는 것으로 생각했는데, 제 생각이 틀린 것일까요?좋은 강의 해주셔서 진심으로 감사합니다!
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
entity 구현 1:1 강의 질문입니다.
안녕하세요. 좋은 강의 감사합니다.entity 구현 1:1 강의에서 npm i 후 package: '@angular-devkit/core@15.1.4', Unsupported engine 이라고 나오는데, 이렇게 터미널에 찍히는 이유가 무엇인가요?계속 사용할 경우 어떤 문제가 발생하나요? npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '@angular-devkit/core@15.1.4', npm WARN EBADENGINE required: { npm WARN EBADENGINE node: '^14.20.0 || ^16.13.0 || >=18.10.0', npm WARN EBADENGINE npm: '^6.11.0 || ^7.5.6 || >=8.0.0', npm WARN EBADENGINE yarn: '>= 1.13.0' npm WARN EBADENGINE }, npm WARN EBADENGINE current: { node: 'v16.12.0', npm: '8.1.0' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '@angular-devkit/schematics@15.1.4', npm WARN EBADENGINE required: { npm WARN EBADENGINE node: '^14.20.0 || ^16.13.0 || >=18.10.0', npm WARN EBADENGINE npm: '^6.11.0 || ^7.5.6 || >=8.0.0', npm WARN EBADENGINE yarn: '>= 1.13.0' npm WARN EBADENGINE }, npm WARN EBADENGINE current: { node: 'v16.12.0', npm: '8.1.0' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '@angular-devkit/schematics-cli@15.1.4', npm WARN EBADENGINE required: { npm WARN EBADENGINE node: '^14.20.0 || ^16.13.0 || >=18.10.0', npm WARN EBADENGINE npm: '^6.11.0 || ^7.5.6 || >=8.0.0', npm WARN EBADENGINE yarn: '>= 1.13.0' npm WARN EBADENGINE }, npm WARN EBADENGINE current: { node: 'v16.12.0', npm: '8.1.0' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '@angular-devkit/core@15.0.4', npm WARN EBADENGINE required: { npm WARN EBADENGINE node: '^14.20.0 || ^16.13.0 || >=18.10.0', npm WARN EBADENGINE npm: '^6.11.0 || ^7.5.6 || >=8.0.0', npm WARN EBADENGINE yarn: '>= 1.13.0' npm WARN EBADENGINE }, npm WARN EBADENGINE current: { node: 'v16.12.0', npm: '8.1.0' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '@angular-devkit/schematics@15.0.4', npm WARN EBADENGINE required: { npm WARN EBADENGINE node: '^14.20.0 || ^16.13.0 || >=18.10.0', npm WARN EBADENGINE npm: '^6.11.0 || ^7.5.6 || >=8.0.0', npm WARN EBADENGINE yarn: '>= 1.13.0' npm WARN EBADENGINE }, npm WARN EBADENGINE current: { node: 'v16.12.0', npm: '8.1.0' } npm WARN EBADENGINE } npm WARN deprecated apollo-datasource@3.3.2: The `apollo-datasource` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. npm WARN deprecated apollo-server-errors@3.3.1: The `apollo-server-errors` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. npm WARN deprecated apollo-server-plugin-base@3.7.1: The `apollo-server-plugin-base` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. npm WARN deprecated apollo-server-types@3.7.1: The `apollo-server-types` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead npm WARN deprecated apollo-server-express@3.11.1: The `apollo-server-express` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. npm WARN deprecated apollo-reporting-protobuf@3.3.3: The `apollo-reporting-protobuf` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/usage-reporting-protobuf` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. npm WARN deprecated apollo-server-env@4.2.1: The `apollo-server-env` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/utils.fetcher` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. npm WARN deprecated subscriptions-transport-ws@0.11.0: The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md npm WARN deprecated apollo-server-core@3.11.1: The `apollo-server-core` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. added 806 packages, and audited 807 packages in 21s 98 packages are looking for funding run `npm fund` for details found 0 vulnerabilities
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
Error: Access denied for user 'root'@'localhost' (using password: YES) 에러
아래 질문과 동일한 에러가 발생해서 알려주신 해결책으로 진행했는데...이번에는 다른 문제가 발생했습니다.Error: Access denied for user 'root'@'localhost' (using password: YES)구글링으로 아무리 찾아서 해보아도 해결이 안되고 있습니다.아래 테이블 만들었구요권한문제인가 싶어서 user 테이블의 root 의 authentication_string 을 바꿔도 해쉬값으로 저장되지도 않고...현재는 NULL로 해놓고 있는데 도무지 해결이 되지 않습니다. 도와주세요 ㅠㅠ
-
미해결Slack 클론 코딩[백엔드 with NestJS + TypeORM]
seeder is not a constructor
yarn seed를 통해 더미데이터를 생성하려 했으나 "seeder is not a constructor" 라는 에러에 마주칩니다. 어느 부분이 잘못됫는지 알아보기 위해 에러코드를 살펴봤으나 제 코드 부분이 아닌 typeorm-extension 부분에서 에러가 나는것 같아 해결하기 어렵습니다.TypeError: seeder is not a constructor at /Users/jinyoung/Desktop/try-own-version/practice-version/node_modules/typeorm-extension/src/seeder/module.ts:122:19 at Generator.next (<anonymous>) at fulfilled (/Users/jinyoung/Desktop/try-own-version/practice-version/node_modules/typeorm-extension/dist/seeder/module.js:5:58) dataSource.ts import dotenv from 'dotenv'; //dataSource에 entity를 입력해줄때는 절대경로면 못찾아온다. 그래서 상대 경로로 써줘야함 import { User } from './src/users/entities/user.entity'; import { DataSource } from 'typeorm'; const mode = process.env.NODE_ENV || 'development'; dotenv.config({ path: process.cwd() + `/.env.${mode}` }); const dataSource = new DataSource({ type: 'mysql', host: 'localhost', port: 3306, database: process.env.DB_DATABASE, username: process.env.DB_USERNAME, password: process.env.DB_PASSWORD, charset: 'utf8mb4_general_ci', entities: [User], migrations: [__dirname + '/src/migrations/*.ts'], synchronize: true, logging: true, }); export default dataSource; package.json seed부분 설정 "seed": "ts-node ./node_modules/typeorm-extension/dist/cli/index.js seed -d ./dataSource.ts" database/seeds/create-initial-data.ts import { User } from '../../users/entities/user.entity'; import { DataSource } from 'typeorm'; import { Seeder, SeederFactoryManager } from 'typeorm-extension'; export class UserSeeder implements Seeder { async run( dataSource: DataSource, factoryManager: SeederFactoryManager, ): Promise<any> { const userRepository = dataSource.getRepository(User); await userRepository.save({ email: 'ggg@gmail.com', firstName: 'sfvs', lastName: 'wdwdwd', nickname: 'hihi', }); } } typeorm-extension 버젼 "typeorm-extension": "^2.4.2", "typeorm": "^0.3.12", 시도해본 내용1. dataSource 생성시 new DataSource({... 중략seed:["create-initial-data.ts 경로"] 추가})2. db 삭제후 다시 생성(생성시 테이블 싱크까지 맞춘후 seed 시도)3. typeorm-extension 버전 문제일까 해서 다운그레이드 시도4. typeorm 0.3대는 유지하고 0.3.11, 0.3.10등 다른 버전으로 시도결과 모두 실패
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
save 파라미터에 스프레드 안쓰고 객체를 넘겨도 되나요?
const savedProductSaleslocation = await this.productSaleslocationRepository.save({ ...productSaleslocation, });위 코드에서, 아래처럼 코드를 바꿔봤습니다. const savedProductSaleslocation = await this.productSaleslocationRepository.save(productSaleslocation);정상 작동했는데 차이가 무엇인가요? 또 권장하는 방식은 무엇인가요?
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
우분투에 몽고디비 설치 후 실행이 안됩니다.
제가 사용중인 우분투 버젼입니다.몽고 디비 설치를 노션 자료에 있는대로도 설치를 해보고, 삭제하고 공식문서에 있는대로도 설치를 해봤는데(노션에는 공개키가 server-5.0 으로 되어있고 공식 문서는 server-6.0 으로 되어있더라구요)설치 후에 실행을 해보면 [fail] 이 뜨면서 실행이 되지 않네요.구글링해서 여러가지 방법 따라해봐도 계속 fail 이어서 질문글 올립니다.추가로 이상한 점은 mongod --version 이라고 치면버전이 나오는게 아니라 Illegal instruction 라고 나옵니다.++구글에 mongod --version Illegal instruction 라는 키워드로 검색을 해서 https://info-orgs.blogspot.com/2021/10/how-to-install-mongodb-v44-mongodb.html이 글을 보고 몽고 디비 4.4 버전을 설치해봤는데mongod --version 이라고 치면 이제 버전이 나오긴 하는데 여전히 실행은 실패하네요.$ service mongod start * Starting database mongod /etc/init.d/mongod: 136: ulimit: error setting limit (Operation not permitted) /etc/init.d/mongod: 142: ulimit: error setting limit (Operation not permitted) start-stop-daemon: start-stop-daemon: unable to open pidfile '/var/run/mongod.pid' for writingunable to set gid to 121 (Permission denied) (Operation not permitted) start-stop-daemon: child returned error exit status 2
-
해결됨탄탄한 백엔드 NestJS, 기초부터 심화까지
[SOLVE] 고양이 프로젝트 로그인 API 프론트엔드 연결 문제
네트워크 소스 확인해보니, 같은 강의에서 수행된 Swagger에서 사용한 Header(Authorization)이 살아있고 이를 이용해 로그인 시도하는 것을 확인했습니다.swagger 로그인을 수행하신 분들은 기존 쿠키 삭제하고 다시 시도하시면 정상 로그인 됩니다.안녕하세요 고양이 프로젝트 로그인 API 연결이 잘 안되어 질문드립니다.포스트맨에서는 로그인이 정상적으로 수행됩니다.그런데 프론트에서 로그인을 수행하면 다음과 같이 Unauthorized 에러가 발생합니다.비밀번호를 다르게 입력해보니 이메일과 비밀번호를 확인하라는 에러가 뜨는걸로 봐서 뭔가 다른 문제가 있는것 같습니다. 아마 프론트 문제인것같은데 어떻게 해결해야할지 모르겠습니다...도움주시면 감사하겠습니다.
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
현재 nodemon 커널 실행 nodemon yarn aaa 부분 수강중 입니다.
윈도우 환경에서 yarn 이 에러가 나서 npm으로 진행중입니다~"npm yarn 은 성능만 차이가 나고 명령어는 똑같다" 라고 알고 있는데,명령어도 다른건가 라는 의문이 들어 질문 드립니다. npm의 경우는pakage.js 에 아래와 같이 작성 후npm aaa 로는 실행이 안되고,npm run aaa 로 만 실행이 되는데,yarn aaa 는 실행이 잘 되는듯 하네요왜 그런 걸까요? run 이 생략된 걸까요?웹펙 쪽을 먼저 학습하고 가야 할지...수업 들으면서 모르는걸 다 질문드려도 될까요?package.jsonscript:{"aaa":"nodemon app.js"}
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
퍼사드 패턴 코드 공유 드립니다!
퍼사드 패턴 관련하여 노션 코드는 강의 코드와 다르기때문에, 에러를 해결하지 못하신 분들을 위해서 코드 공유 드립니다.(에러메세지로 위치, 그 위치에 해당하는 강사님이 강의 진행시 적어주셨던 코드와 대조하여서 작성하였습니다)// 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 + '를 전송합니다!!'); }
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
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을 별도로 관리하는 방법은 없을까요?
-
미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
[SOLVED] 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.logNestJS에서 supertest 설치를 위해 jest 패키지를 설치하는 것 같은데, jest 패키지들이 정상적으로 (로그에 의하면 ts-jest) 설치되지 않습니다.같은 에러를 겪은적 있으시거나, 해결법 아시는 분 도움 부탁드립니다.감사합니다.
-
미해결따라하며 배우는 NestJS
강의자료 다운로드 관련
안녕하세요! 강의 잘 듣고 있는 수강생입니다.강의자료 다운 받으면 pdf, xml 모두 폴더가 비어 있습니다.(DS_store 파일만 있어서요..)혹시 제가 모르는 부분이 있으면 알려주시면 감사하겠습니다!
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
module imports로 주입 vs providers로 주입
위의 두개의 사진처럼 UserService를 바로 providers로 넣는 것과, UserModule에서 Service를 export 한 후 모듈 자체를 import 하는 것의 차이점과 어떤 경우에 두가지 방식을 구분하여 사용하는지 궁금합니다.
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
console.log 실행불가
package.json 파일까지 추가해서 해봤는데도 실행이 안되네요 해결방법 알고싶습니다