Repository: TypeScript
Issue: `moduleResolution: node` doesn't align with Node's module resolution when targeting ES2015.
Labels: Needs Investigation,Rescheduled

**TL;DR**: When resolving CommonJS modules in NodeJS, it will implicitly look for an `index.js` file within a folder if the folder matches the import path.  When resolving ES2015 modules in NodeJS however, this is not true.  Currently, TypeScript will always implicitly resolve `index.js` in a folder matching the provided import path, even if module is ES2015.  This results in TypeScript spitting out JS without error when there is no runtime that will execute the code.

<!--
Please try to reproduce the issue with the latest published version. It may have already been fixed.
For npm: `typescript@next`
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly
-->
**TypeScript Version:**  3.9.3

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**
moduleResolution node es modules 

**Code**

```json
// tsconfig.json
{
    "compilerOptions": {
        "module": "ES2015",
        "moduleResolution": "node",
    }
}
```

```ts
// apple/index.ts
export const apple = 'red'

// index.ts
import { apple } from './apple'
```

**Expected behavior:**
An error indicating that module `./apple` could not be found.

**Actual behavior:**
No error and it emits `import { apple } from './apple'`.

**Related Issues:** <!-- Did you find other bugs that looked similar? -->
The opposite request (declined): #32432
Tangentially related to all of the discussions around TypeScript appending `.js` extensions.

Thanks to @bouzuya for the following script showing module resolution in NodeJS when resolving ES2015 modules vs CommonJS modules:
```bash
#!/bin/bash

if [ -z "$1" ]; then echo 'Usage: ./node-esm-test.sh <0|1|2|3|4|5>'; exit 1; fi

echo 'node --version'
node --version # v14.2.0

case $1 in
  0)
    echo "case 0: Node.js CJS resolves './add' -> './add/index.js'"
    mkdir node-esm-test
    cd node-esm-test
    mkdir add
    echo 'exports.add = function(a, b) { return a + b; };' > add/index.js
    echo 'const { add } = require("./add"); console.log(add(1, 2) === 3 ? "OK" : "NG");' > mod.js
    # OK
    node mod.js || true
    cd ..
    rm -rf node-esm-test
    ;;

  1)
    echo "case 1: Node.js ESM resolves './add/index.js' -> './add/index.js'"
    mkdir node-esm-test
    cd node-esm-test
    mkdir add
    echo 'export function add(a, b) { return a + b; }' > add/index.js
    echo 'import { add } from "./add/index.js"; console.log(add(1, 2) === 3 ? "OK" : "NG");' > mod.js
    echo '{"type":"module"}' > package.json
    # OK
    node mod.js || true
    cd ..
    rm -rf node-esm-test
    ;;

  2)
    echo "case 2: Node.js ESM doesn't resolve './add/index' -> './add/index.js'"
    mkdir node-esm-test
    cd node-esm-test
    mkdir add
    echo 'export function add(a, b) { return a + b; }' > add/index.js
    echo 'import { add } from "./add/index"; console.log(add(1, 2) === 3 ? "OK" : "NG");' > mod.js
    echo '{"type":"module"}' > package.json
    # cannot find module ... Did you mean to import ../add/index.js?
    node mod.js || true
    cd ..
    rm -rf node-esm-test
    ;;

  3)
    echo "case 3: Node.js ESM doesn't resolve './add' -> './add/index.js'"
    mkdir node-esm-test
    cd node-esm-test
    mkdir add
    echo 'export function add(a, b) { return a + b; }' > add/index.js
    echo 'import { add } from "./add"; console.log(add(1, 2) === 3 ? "OK" : "NG");' > mod.js
    echo '{"type":"module"}' > package.json
    # cannot find module ... Did you mean to import ../add/index.js?
    node mod.js || true
    cd ..
    rm -rf node-esm-test
    ;;

  4)
    echo "case 4: Node.js ESM doesn't resolve './add.js' -> './add/index.js'"
    mkdir node-esm-test
    cd node-esm-test
    mkdir add
    echo 'export function add(a, b) { return a + b; }' > add/index.js
    echo 'import { add } from "./add.js"; console.log(add(1, 2) === 3 ? "OK" : "NG");' > mod.js
    echo '{"type":"module"}' > package.json
    # cannot find module
    node mod.js || true
    cd ..
    rm -rf node-esm-test
    ;;

  5)
    echo "case 5: Node.js ESM doesn't resolve './add' -> './add/index.mjs'"
    mkdir node-esm-test
    cd node-esm-test
    mkdir add
    echo 'export function add(a, b) { return a + b; }' > add/index.mjs
    echo 'import { add } from "./add"; console.log(add(1, 2) === 3 ? "OK" : "NG");' > mod.mjs
    # cannot find module
    node mod.mjs || true
    cd ..
    rm -rf node-esm-test
    ;;

esac
```