Nest JS Build不生成dist文件夹 [英] Nest JS build does does not generate the dist folder

查看:45
本文介绍了Nest JS Build不生成dist文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用Nest js实现了睡觉接口项目,在本地环境下运行良好。(Pm Start)

我想构建并部署它。但是,生成命令不会生成灰尘文件夹。以下是我的配置

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"
  }

当我执行npm run build时,没有任何反应。没有错误。没有dist文件夹。 有人能帮助我解决此问题吗?

推荐答案

一旦我将Package.json文件中的打字版本更新到3.7.2,就会生成dist文件夹。以前是3.4.1

"typescript": "3.7.2",

这篇关于Nest JS Build不生成dist文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆