node.jsnestjs

Nest JS build does does not generate the dist folder


I have implemented rest api project with nest js.it is working fine on local environment.(pm start)

I want to build it and deploy. but build command does not generate the dust folder. following is my configurations

tsconfig.json

{
  "compilerOptions": {
    "module": "commonjs",
    "declaration": true,
    "removeComments": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es6",
    "sourceMap": true,
    "outDir": "./dist",
    "baseUrl": "./",
    "incremental": true,
    "resolveJsonModule": true,
    "esModuleInterop": true,
    "allowJs": true,
    "checkJs": true, 
    "noEmit": true
  },
  "exclude": ["node_modules"],
  "paths": {
    "@app/*": ["src/*"],
    "@test/*": ["test/*"]
  }
}

package.json

 "scripts": {
    "build": "tsc -p tsconfig.build.json",
    "format": "prettier --write \"src/**/*.ts\"",
    "start": "npm run start:prod",
    "start:dev": "concurrently --handle-input \"wait-on dist/main.js && nodemon\" \"tsc -w -p tsconfig.build.json\" ",
    "start:prod": "node dist/src/main.js",
    "lint": "tslint -p tsconfig.json -c tslint.json",
    "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",
    "gcp-build": "npm run build"
  }

when I execute the npm run build nothing happens. no errors. no dist folder. can any one help me to fix this issue?


Solution

  • Once I update the typescript version into 3.7.2 in package.json file, dist folder generated.previously it was 3.4.1

    "typescript": "3.7.2",