为什么运行main.js时Nest.js抛出错误? [英] Why Nest.js throw a error when run main.js?

查看:134
本文介绍了为什么运行main.js时Nest.js抛出错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Nest.js开发Web后端.

I am using Nest.js to develop a web backend.

当我使用npm run build时,cmd显示成功.

When I use npm run build, the cmd shows success.

但是当我使用node dist/main.js时,cmd显示错误.但是我确定此文件存在并且处于开发模式(npm run start)中,一切正常.

But when I use node dist/main.js, the cmd shows error. But I'm sure this file exist and in develop mode (npm run start), everything's ok.

这是github地址. https://github.com/Eve-1995/Oreo/树/主/oreo后端

This is github address. https://github.com/Eve-1995/Oreo/tree/master/oreo-back-end

接下来我该怎么办?

推荐答案

entities: [__dirname + '/../**/**/!(*.d).entity.{ts,js}'],在生产环境和开发环境中都对我有用.

entities: [__dirname + '/../**/**/!(*.d).entity.{ts,js}'], is doing the trick for me both in production and dev envs.

这篇关于为什么运行main.js时Nest.js抛出错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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