<p dir="auto">I installed babel and run <code class="notranslate">babel-node</code> which version is 5.8.21.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt; const b = 1
'use strict'
&gt; b =2 
2
&gt; b
2
&gt; const b = 3
'use strict'
&gt; b
3"><pre class="notranslate"><span class="pl-c1">&gt;</span> <span class="pl-k">const</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span>
<span class="pl-s">'use strict'</span>
<span class="pl-c1">&gt;</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span><span class="pl-c1">2</span> 
<span class="pl-c1">2</span>
<span class="pl-c1">&gt;</span> <span class="pl-s1">b</span>
<span class="pl-c1">2</span>
<span class="pl-c1">&gt;</span> <span class="pl-s1">const</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-c1">3</span>
<span class="pl-s">'use strict'</span>
<span class="pl-c1">&gt;</span> <span class="pl-s1">b</span>
<span class="pl-c1">3</span></pre></div>
<p dir="auto">Obviously the ES6 code result is not correct. I compile the code with io.js, it throw the erro message:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="TypeError: Identifier 'b' has already been declared"><pre class="notranslate">TypeError: <span class="pl-v">Identifier</span><span class="pl-kos"></span> <span class="pl-s">'b'</span> <span class="pl-s1">has</span> <span class="pl-s1">already</span> <span class="pl-s1">been</span> <span class="pl-s1">declared</span></pre></div>
<p dir="auto">Why babel-node let  constant variable changed？</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ babel-node
&gt; const PI = 3.14
'use strict'
&gt; PI = 0 // Try to change a constant value
0
&gt; PI
0
&gt;"><pre class="notranslate"><code class="notranslate">$ babel-node
&gt; const PI = 3.14
'use strict'
&gt; PI = 0 // Try to change a constant value
0
&gt; PI
0
&gt;
</code></pre></div>
<p dir="auto">This problem only happens inside the REPL, it should throw an error since <code class="notranslate">babel</code> and <code class="notranslate">babel-node -e</code> can produce the error correctly.<br>
<em>Babel version: v5.6.14</em></p>