title: Having an error "MissingDriverError: Wrong driver: "undefined" given." while generating migration with TypeORM
body: <p>I'm trying to generate migrations. I have added these lines to package.json</p>
  <pre><code> &quot;typeorm&quot;: &quot;node --require ts-node/register ./node_modules/typeorm/cli.js  --config src/config/configuration.ts&quot;,
   &quot;migration:generate&quot;:&quot;npm run typeorm migration:generate -- -n&quot;
  </code></pre>
  <p>I have a configuration.ts file instead of ormconfig.json which looks like this.</p>
  <pre><code>import { join } from 'path';
  
  export default () =&gt; {
    const host = process.env.DB_HOST;
    const port = process.env.DB_PORT;
    const username = process.env.DB_USERNAME;
    const password = process.env.DB_PASSWORD;
    const database = process.env.DB_DATABASE;
  
    return {
      database: {
        type: 'mariadb',
        host,
        port,
        username,
        password,
        database,
        entities: ['dist/**/*.entity{.ts,.js}'],
        synchronize: false,
        migrations: ['/src/migration/**/*.ts'],
        keepConnectionAlive: true,
        charset: 'utf8mb4',
        cli: {
          migrationsDir: '/src/migrations',
        },
      },
    };
  };
  
  </code></pre>
  <p>while running the command</p>
  <pre><code>npm run migration:generate -- softDeleteUser
  </code></pre>
  <p>having this error</p>
  <pre><code>&gt; user-service@0.0.1 migration:generate
  &gt; npm run typeorm migration:generate -- -n &quot;softDeleteUser&quot;
  
  
  &gt; user-service@0.0.1 typeorm
  &gt; node --require ts-node/register ./node_modules/typeorm/cli.js  --config src/config/configuration.ts &quot;migration:generate&quot; &quot;-n&quot; &quot;softDeleteUser&quot;
  
  Error during migration generation:
  MissingDriverError: Wrong driver: &quot;undefined&quot; given. Supported drivers are: &quot;cordova&quot;, &quot;expo&quot;, &quot;mariadb&quot;, &quot;mongodb&quot;, &quot;mssql&quot;, &quot;mysql&quot;, &quot;oracle&quot;, &quot;postgres&quot;, &quot;sqlite&quot;, &quot;better-sqlite3&quot;, &quot;sqljs&quot;, &quot;react-native&quot;, &quot;aurora-data-api&quot;, &quot;aurora-data-api-pg&quot;.
  at new MissingDriverError (/Users/akash/Documents/Projects/pulp-backend/user-service/src/error/MissingDriverError.ts:8:9)
      at DriverFactory.create (/Users/akash/Documents/Projects/pulp-backend/user-service/src/driver/DriverFactory.ts:67:23)
      at new Connection (/Users/akash/Documents/Projects/pulp-backend/user-service/src/connection/Connection.ts:128:43)
      at ConnectionManager.create (/Users/akash/Documents/Projects/pulp-backend/user-service/src/connection/ConnectionManager.ts:64:28)
      at Object.&lt;anonymous&gt; (/Users/akash/Documents/Projects/pulp-backend/user-service/src/index.ts:230:35)
      at step (/Users/akash/Documents/Projects/pulp-backend/user-service/node_modules/tslib/tslib.js:141:27)
      at Object.next (/Users/akash/Documents/Projects/pulp-backend/user-service/node_modules/tslib/tslib.js:122:57)
      at /Users/akash/Documents/Projects/pulp-backend/user-service/node_modules/tslib/tslib.js:115:75
      at new Promise (&lt;anonymous&gt;)
      at Object.__awaiter (/Users/akash/Documents/Projects/pulp-backend/user-service/node_modules/tslib/tslib.js:111:16)
  </code></pre>
  <p>Any suggestions?</p>