我有一个使用nestjs和typeorm的应用程序。在开发模式下运行时,一切正常。
在vscode中调试时出错。
这是我的文件夹结构
launch.json:
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Backend",
"args": [
"${workspaceFolder}/backend/src/main.ts"
],
"runtimeArgs": [
"--nolazy",
"-r",
"ts-node/register",
"-r",
"tsconfig-paths/register"
],
"sourceMaps": true,
"cwd": "${workspaceRoot}/backend",
"console": "integratedTerminal",
"protocol": "inspector"
}
]
ormconfig.json
{
"type": "mysql",
"host": "localhost",
"port": 3306,
"username": "root",
"password": "*",
"database": "database",
"entities": ["dist/**/*.entity{.ts,.js}"],
"supportBigNumbers": true,
"bigNumberStrings": false,
"synchronize": false
}
如果你能帮我,我很感激
现在如果它在调试和开发模式下都能工作。我澄清我安装了dotenv,并在我的app.module中添加了require ('dotenv'). Config ();
非常感谢