Nest: Nest exits silently after upgrading to Node 14

Created on 7 Jul 2020  路  3Comments  路  Source: nestjs/nest

Bug Report

Current behavior


After upgrading Node 12 to Node 14, without changing any code, and even with a simplified app with only TypeOrm, Nest doesn't start anymore and exits with code 0:

[Nest] 74018   - 07/07/2020, 2:34:51 PM   [NestFactory] Starting Nest application...
[Nest] 74018   - 07/07/2020, 2:34:51 PM   [InstanceLoader] AppModule dependencies initialized +42ms
[Nest] 74018   - 07/07/2020, 2:34:51 PM   [InstanceLoader] TypeOrmModule dependencies initialized +1ms

Process finished with exit code 0

Input Code


app.module.ts

import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import config from './ormconfig';

@Module({
  imports: [
    TypeOrmModule.forRoot(config),
  ],
  providers: [],
  controllers: [],
})
export class AppModule {}

ormconfig.ts

import { ConnectionOptions } from "typeorm";
import { env } from './utils/env';

const config: ConnectionOptions = {
  type: 'postgres',
  host: env.POSTGRES_HOST,
  port: env.POSTGRES_PORT,
  username: env.POSTGRES_USER,
  password: env.POSTGRES_PASSWORD,
  database: env.POSTGRES_DATABASE,
  synchronize: true,
  logging: env.NODE_ENV !== "production",
  entities: [
    __dirname + '/**/*.entity{.ts,.js}',
  ],
};

export default config;

Expected behavior


Nest should start as before, or show an error explaining what's going on.

Possible Solution

Environment


Nest version: 7.0.3


For Tooling issues:
- Node version: 14.5.0  
- Platform: Mac  

Others:

needs clarification

Most helpful comment

I had the same issue and was able to pinpoint it to pg@^7.0.0. After updating to pg@^8.0.0, nest would work as expected.

All 3 comments

Please provide a minimum reproduction repository.

I had the same issue and was able to pinpoint it to pg@^7.0.0. After updating to pg@^8.0.0, nest would work as expected.

I updated pg from 7.18.2 to 8.3.0 and it worked like a charm. Thank you @dislick.

Was this page helpful?
0 / 5 - 0 ratings