问题描述
我正在使用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抛出错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!