Repository: deno
Issue: TypeError: process.cwd is not a function when trying to run typeorm migration:run
Labels: bug,needs info,node compat

Version: Deno 2.1.2
Mac M1 Pro@

I am trying to run the typeorm CLI to generate or run migration files. According to the documentation, process.cwd should be defined when using a node/npm module: https://docs.deno.com/runtime/fundamentals/node/#node.js-global-objects

However, here is the error I encounter:
```
deno $ deno task typeorm
Task typeorm typeorm migration:run -d ./src/data-source.ts
Error during migration run:
TypeError: process.cwd is not a function
    at Object.handler (file:///Library/Caches/deno/npm/registry.npmjs.org/typeorm/0.3.20/commands/MigrationRunCommand.js:40:106)
    at file:///Library/Caches/deno/npm/registry.npmjs.org/yargs/17.7.2/build/index.cjs:1:9229
    at j (file:///Library/Caches/deno/npm/registry.npmjs.org/yargs/17.7.2/build/index.cjs:1:5192)
    at _.handleValidationAndGetResult (file:///Library/Caches/deno/npm/registry.npmjs.org/yargs/17.7.2/build/index.cjs:1:9198)
    at _.applyMiddlewareAndGetResult (file:///Library/Caches/deno/npm/registry.npmjs.org/yargs/17.7.2/build/index.cjs:1:9840)
    at _.runCommand (file:///Library/Caches/deno/npm/registry.npmjs.org/yargs/17.7.2/build/index.cjs:1:7467)
    at te.[runYargsParserAndExecuteCommands] (file:///Library/Caches/deno/npm/registry.npmjs.org/yargs/17.7.2/build/index.cjs:1:58775)
    at te.parse (file:///Library/Caches/deno/npm/registry.npmjs.org/yargs/17.7.2/build/index.cjs:1:40714)
    at te.get [as argv] (file:///Library/Caches/deno/npm/registry.npmjs.org/yargs/17.7.2/build/index.cjs:1:62264)
    at Object.<anonymous> (file:///Library/Caches/deno/npm/registry.npmjs.org/typeorm/0.3.20/cli.js:41:24)
typeorm migration:run

Runs all pending migrations.

Options:
  -h, --help         Show help                                         [boolean]
  -d, --dataSource   Path to the file where your DataSource instance is defined.
                                                                      [required]
  -t, --transaction  Indicates if transaction should be used or not for
                     migration run. Enabled by default.     [default: "default"]
  -f, --fake         Fakes running the migrations if table schema has already
                     been changed manually or externally (e.g. through another
                     project)                         [boolean] [default: false]
  -v, --version      Show version number                               [boolean]

TypeError: process.exit is not a function
    at Object.handler (file:///Library/Caches/deno/npm/registry.npmjs.org/typeorm/0.3.20/commands/MigrationRunCommand.js:77:21)
    at file:///Library/Caches/deno/npm/registry.npmjs.org/yargs/17.7.2/build/index.cjs:1:9229
    at j (file:///Library/Caches/deno/npm/registry.npmjs.org/yargs/17.7.2/build/index.cjs:1:5192)
    at _.handleValidationAndGetResult (file:///Library/Caches/deno/npm/registry.npmjs.org/yargs/17.7.2/build/index.cjs:1:9198)
    at _.applyMiddlewareAndGetResult (file:///Library/Caches/deno/npm/registry.npmjs.org/yargs/17.7.2/build/index.cjs:1:9840)
    at _.runCommand (file:///Library/Caches/deno/npm/registry.npmjs.org/yargs/17.7.2/build/index.cjs:1:7467)
    at te.[runYargsParserAndExecuteCommands] (file:///Library/Caches/deno/npm/registry.npmjs.org/yargs/17.7.2/build/index.cjs:1:58775)
    at te.parse (file:///Library/Caches/deno/npm/registry.npmjs.org/yargs/17.7.2/build/index.cjs:1:40714)
    at te.get [as argv] (file:///Library/Caches/deno/npm/registry.npmjs.org/yargs/17.7.2/build/index.cjs:1:62264)
    at Object.<anonymous> (file:///Library/Caches/deno/npm/registry.npmjs.org/typeorm/0.3.20/cli.js:41:24)
```

Steps to reproduce:
```
// deno.json
{
  "tasks": {
    "typeorm": "typeorm migration:run -d ./src/data-source.ts"
  },
  "imports": {
    "reflect-metadata": "npm:reflect-metadata",
    "typeorm": "npm:typeorm"
  }
}

// src/data-source.ts
import "reflect-metadata"
import { DataSource } from "typeorm"
import { User } from "./entity/User"

export const AppDataSource = new DataSource({
    type: "postgres",
    host: "localhost",
    port: 5432,
    username: "test",
    password: "test",
    database: "test",
    synchronize: true,
    logging: false,
    entities: [User],
    migrations: [],
    subscribers: [],
})


// then run `deno task typeorm`
```