Issue 1:
This code worked before:

function A () { let a }
function B () { let a }

Now I get a TypeError:

TypeError: foo.js: Line 2: Duplicate declaration "a"
1 | function A () { let a }
> 2 | function B () { let a }
| ^
3 |
at File.errorWithNode (/usr/lib/node_modules/babel/node_modules/babel-core/lib/babel/transformation/file/index.js:436:15)
at Scope.checkBlockScopedCollisions (/usr/lib/node_modules/babel/node_modules/babel-core/lib/babel/traversal/scope.js:287:23)
at Scope.registerBinding (/usr/lib/node_modules/babel/node_modules/babel-core/lib/babel/traversal/scope.js:424:12)
at Scope.registerDeclaration (/usr/lib/node_modules/babel/node_modules/babel-core/lib/babel/traversal/scope.js:384:14)
at TraversalPath.enter (/usr/lib/node_modules/babel/node_modules/babel-core/lib/babel/traversal/scope.js:79:13)
at TraversalPath.call (/usr/lib/node_modules/babel/node_modules/babel-core/lib/babel/traversal/path/index.js:443:26)
at TraversalPath.visit (/usr/lib/node_modules/babel/node_modules/babel-core/lib/babel/traversal/path/index.js:455:10)
at TraversalContext.visitMultiple (/usr/lib/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:50:16)
at TraversalContext.visit (/usr/lib/node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:71:19)
at Function.traverse.node (/usr/lib/node_modules/babel/node_modules/babel-core/lib/babel/traversal/index.js:44:17)

Is this a bug, or did block scoping change, or am I going crazy?

Issue 2:
So to test babel, I ran a bunch of commands:

mkdir babel-test
cd babel-test
echo "export async function foo(){}" > src.js
echo "{ \"presets\": [ \"es2015\", \"stage-0\" ] }" > .babelrc
npm i babel-cli@latest -g
npm i babel-preset-es2015@latest
npm i babel-preset-stage-0@latest

When I ran babel src.js now, I got the following error:

Error: src.js: Expected type "Identifier" with option {}
at Object.t.(anonymous function) [as assertIdentifier] (C:\Sandbox\babel-test\node_modules\babel-types\lib\index.js:80:13)
at PluginPass.exports.visitor.Function.exit (C:\Sandbox\babel-test\node_modules\babel-plugin-transform-regenerator\lib\visit.js:78:9)
at c:\Program Files\nodejs\node_modules\babel-cli\node_modules\babel-traverse\lib\visitors.js:271:19
at NodePath._call (c:\Program Files\nodejs\node_modules\babel-cli\node_modules\babel-traverse\lib\path\context.js:72:18)
at NodePath.call (c:\Program Files\nodejs\node_modules\babel-cli\node_modules\babel-traverse\lib\path\context.js:44:17)
at NodePath.visit (c:\Program Files\nodejs\node_modules\babel-cli\node_modules\babel-traverse\lib\path\context.js:108:8)
at TraversalContext.visitQueue (c:\Program Files\nodejs\node_modules\babel-cli\node_modules\babel-traverse\lib\context.js:151:16)
at TraversalContext.visitMultiple (c:\Program Files\nodejs\node_modules\babel-cli\node_modules\babel-traverse\lib\context.js:106:17)
at TraversalContext.visit (c:\Program Files\nodejs\node_modules\babel-cli\node_modules\babel-traverse\lib\context.js:193:19)
at Function.traverse.node (c:\Program Files\nodejs\node_modules\babel-cli\node_modules\babel-traverse\lib\index.js:139:17)

Since I wasn't sure what had caused the error, I ran babel-doctor:

Babel Doctor
Running sanity checks on your system. This may take a few minutes...

√ Found config at C:\Sandbox\babel-test\.babelrc
√ No duplicate babel packages found

× We found some outdated packages:

- babel-runtime - Latest is 6.0.14. Local version is 5.8.29

√ You're on npm >=3.3.0

Found potential issues on your machine :(

To fix this, I ran npm i babel-runtime@latest. However, running babel-doctor again produced this output:

Babel Doctor
Running sanity checks on your system. This may take a few minutes...

√ Found config at c:\Sandbox\babel-test\.babelrc

× Found these duplicate packages:

- babel-runtime x 61

Recommend running `npm dedupe`

× We found some outdated packages:

- babel-runtime - Latest is 6.0.14. Local version is 5.8.29
/* REMOVED 59 LINES HERE */
- babel-runtime - Latest is 6.0.14. Local version is 5.8.29

√ You're on npm >=3.3.0

Found potential issues on your machine :(

So I ran npm dedupe babel-runtime and babel-doctor again, but nothing changed.

I figured, perhaps I had to update the global module. Before doing this, I first reset the local modules by running rm -rf node_modules, npm i babel-preset-es2015@latest and npm i babel-preset-stage-0@latest. I then ran npm i babel-runtime -g and babel-doctor again, but it still said that babel-runtime was outdated.

Now, I don't know what else to do to fix this. Any help is much appreciated. :)