title: connect to mssql in Nestjs with Typeorm, but Nest can't resolve dependencies of the EmployeeRepository
body: <p>I'm connect mssql in Nestjs with Typeorm and get error <code>Nest can't resolve dependencies of the EmployeeRepository</code></p>
  <p>my app.module.ts file:</p>
  <pre><code>import { Module } from '@nestjs/common';
  import { AppController } from './app.controller';
  import { AppService } from './app.service';
  import config from '../ormconfig';
  import { TypeOrmModule } from '@nestjs/typeorm';
  import { EmployeesModule } from './employees/employees.module';
  @Module({
    imports: [
      TypeOrmModule.forRoot({ ...config, autoLoadEntities: true }),
      EmployeesModule,
    ],
    controllers: [AppController],
    providers: [AppService],
  })
  export class AppModule {}
  </code></pre>
  <p>ormconfig.ts file:</p>
  <pre><code>const config: SqlServerConnectionOptions = {
    type: 'mssql',
    host: 'localhost',
    port: 1433,
    username: 'sa',
    password: 'sa',
    database: 'db1',
    synchronize: false,
  };
  
  export default config;
  </code></pre>
  <p>employees.module.ts file:</p>
  <pre><code>import { Module } from '@nestjs/common';
  import { TypeOrmModule } from '@nestjs/typeorm';
  import { Employee } from './employee.entity';
  import { EmployeesController } from './employees.controller';
  import { EmployeesService } from './employees.service';
  @Module({
    imports: [TypeOrmModule.forFeature([Employee])],
    providers: [EmployeesService],
    controllers: [EmployeesController],
  })
  export class EmployeesModule {}
  </code></pre>
  <p>employees.service.ts file:</p>
  <pre><code>import { Injectable } from '@nestjs/common';
  import { InjectRepository } from '@nestjs/typeorm';
  import { Repository } from 'typeorm';
  import { Employee } from './employee.entity';
  
  @Injectable()
  export class EmployeesService {
    constructor(
      @InjectRepository(Employee)
      private employeesRepository: Repository&lt;Employee&gt;,
    ) {}
  
    findAll(): Promise&lt;Employee[]&gt; {
      return this.employeesRepository.find();
    }
  }
  </code></pre>
  <p>employee.entity.ts file:</p>
  <pre><code>import {
    Entity,
    PrimaryGeneratedColumn,
    Column,
    BaseEntity,
  } from 'typeorm';
  
  @Entity('Employees')
  export class Employee extends BaseEntity {
    @PrimaryGeneratedColumn({ type: 'int' })
    EmployeeID!: number;
  
    @Column({ type: 'nvarchar', length: 50 })
    FirstName!: string;
  
    @Column({ type: 'nvarchar', length: 50 })
    LastName!: string;
  ...
  }
  </code></pre>
  <p>the employees.controller.ts file is doing nothing only barebone created by CLI. There is a table called <code>Employees</code> in db1 from mssql. I just cannot figure out why this's happening. I even tried deleting dist and node_modules, but no luck.</p>
  <p>main parts of my package.json</p>
  <pre><code>    &quot;scripts&quot;: {
      &quot;prebuild&quot;: &quot;rimraf dist&quot;,
      &quot;build&quot;: &quot;nest build&quot;,
      &quot;format&quot;: &quot;prettier --write \&quot;src/**/*.ts\&quot; \&quot;test/**/*.ts\&quot;&quot;,
      &quot;start&quot;: &quot;nest start&quot;,
      &quot;start:dev&quot;: &quot;nest start --watch&quot;,
      &quot;start:debug&quot;: &quot;nest start --debug --watch&quot;,
      &quot;start:prod&quot;: &quot;node dist/main&quot;,
      &quot;lint&quot;: &quot;eslint \&quot;{src,apps,libs,test}/**/*.ts\&quot; --fix&quot;,
      &quot;test&quot;: &quot;jest&quot;,
      &quot;test:watch&quot;: &quot;jest --watch&quot;,
      &quot;test:cov&quot;: &quot;jest --coverage&quot;,
      &quot;test:debug&quot;: &quot;node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand&quot;,
      &quot;test:e2e&quot;: &quot;jest --config ./test/jest-e2e.json&quot;
    },
    &quot;dependencies&quot;: {
      &quot;@nestjs/common&quot;: &quot;^7.6.15&quot;,
      &quot;@nestjs/core&quot;: &quot;^7.6.15&quot;,
      &quot;@nestjs/platform-express&quot;: &quot;^7.6.15&quot;,
      &quot;@nestjs/typeorm&quot;: &quot;^7.1.5&quot;,
      &quot;mssql&quot;: &quot;^7.1.0&quot;,
      &quot;reflect-metadata&quot;: &quot;^0.1.13&quot;,
      &quot;rimraf&quot;: &quot;^3.0.2&quot;,
      &quot;rxjs&quot;: &quot;^6.6.6&quot;,
      &quot;typeorm&quot;: &quot;^0.2.34&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;@nestjs/cli&quot;: &quot;^7.6.0&quot;,
      &quot;@nestjs/schematics&quot;: &quot;^7.3.0&quot;,
      &quot;@nestjs/testing&quot;: &quot;^7.6.15&quot;,
      &quot;@types/express&quot;: &quot;^4.17.11&quot;,
      &quot;@types/jest&quot;: &quot;^26.0.22&quot;,
      &quot;@types/node&quot;: &quot;^14.14.36&quot;,
      &quot;@types/supertest&quot;: &quot;^2.0.10&quot;,
      &quot;@typescript-eslint/eslint-plugin&quot;: &quot;^4.19.0&quot;,
      &quot;@typescript-eslint/parser&quot;: &quot;^4.19.0&quot;,
      &quot;eslint&quot;: &quot;^7.22.0&quot;,
      &quot;eslint-config-prettier&quot;: &quot;^8.1.0&quot;,
      &quot;eslint-plugin-prettier&quot;: &quot;^3.3.1&quot;,
      &quot;jest&quot;: &quot;^26.6.3&quot;,
      &quot;prettier&quot;: &quot;^2.2.1&quot;,
      &quot;supertest&quot;: &quot;^6.1.3&quot;,
      &quot;ts-jest&quot;: &quot;^26.5.4&quot;,
      &quot;ts-loader&quot;: &quot;^8.0.18&quot;,
      &quot;ts-node&quot;: &quot;^9.1.1&quot;,
      &quot;tsconfig-paths&quot;: &quot;^3.9.0&quot;,
      &quot;typescript&quot;: &quot;^4.2.3&quot;
    },
  </code></pre>