파크로그
article thumbnail

 

  • class-transformer 모듈 관련 오류였는데, @nestjs/graphql 버전이 8 버전으로 업그레이드 된 상황에서 강의상황에 맞춰가기 위해 7.9.4 버전으로 사용하고 있었음, 그 상황에서 발생한 오류라고 판단
  • global 로 설치된 nestjs cli 를 버전 업 하고, nest js docs 에서 제시한 새로운 graphql 설치 방향으로 진행
    // cli 업데이트
    
    $ npm i -g @nestjs/cli
    
    // graphql 설치
    
    $ npm i @nestjs/graphql graphql apollo-server-express@2.x.x

    • 8 버전의 기본 dependenciesdevDependencies
    "dependencies": {
        "@nestjs/common": "^8.0.0",
        "@nestjs/core": "^8.0.0",
        "@nestjs/platform-express": "^8.0.0",
        "reflect-metadata": "^0.1.13",
        "rimraf": "^3.0.2",
        "rxjs": "^7.2.0"
      },
      "devDependencies": {
        "@nestjs/cli": "^8.0.0",
        "@nestjs/schematics": "^8.0.0",
        "@nestjs/testing": "^8.0.0",
        "@types/express": "^4.17.13",
        "@types/jest": "^27.0.1",
        "@types/node": "^16.0.0",
        "@types/supertest": "^2.0.11",
        "@typescript-eslint/eslint-plugin": "^4.28.2",
        "@typescript-eslint/parser": "^4.28.2",
        "eslint": "^7.30.0",
        "eslint-config-prettier": "^8.3.0",
        "eslint-plugin-prettier": "^3.4.0",
        "jest": "^27.0.6",
        "prettier": "^2.3.2",
        "supertest": "^6.1.3",
        "ts-jest": "^27.0.3",
        "ts-loader": "^9.2.3",
        "ts-node": "^10.0.0",
        "tsconfig-paths": "^3.10.1",
        "typescript": "^4.3.5"
      },

 

  • Cannot find module 'ts-morph'
    • 마찬가지로 nestjs 가 8버전으로 업그레이드 되면서, ts-morph 가 선택사항으로 바뀌었다고 함.
    • 두가지 선택사항으로 고칠 수 있다.
      • ts-config.js 를 8 버전에서 등록된 config 를 사용하거나
      {
        "compilerOptions": {
          "module": "commonjs",
          "declaration": true,
          "removeComments": true,
          "emitDecoratorMetadata": true,
          "experimentalDecorators": true,
          "allowSyntheticDefaultImports": true,
          "target": "es2017",
          "sourceMap": true,
          "outDir": "./dist",
          "baseUrl": "./",
          "incremental": true,
          "skipLibCheck": true,
          "strictNullChecks": false,
          "noImplicitAny": false,
          "strictBindCallApply": false,
          "forceConsistentCasingInFileNames": false,
          "noFallthroughCasesInSwitch": false
        }
      }
      • ts-morph 를 설치하거나
      $npm i ts-morph
profile

파크로그

@파크park

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!