<p dir="auto">The babel-node help says like node's help :</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Usage: babel-node [options] [ -e script | script.js ] [arguments]"><pre class="notranslate">Usage: babel-node [options] [ <span class="pl-k">-e</span> script <span class="pl-k">|</span> script.js ] [arguments]</pre></div>
<p dir="auto">With a myScript.js containing only "console.log(process.argv)", on the following call, -p is taken as a babel-node option instead of a script argument :</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ babel-node myScript.js -p abc
ReferenceError: abc is not defined"><pre class="notranslate">$ babel-node myScript.js -p abc
ReferenceError: abc is not defined</pre></div>
<p dir="auto">Where node outputs :</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ node myScript.js -p abc
[ 'node',
  '/home/fabrice.marsaud/Documents/myScript.js',
  '-p',
  'abc' ]"><pre class="notranslate">$ node myScript.js -p abc
[ <span class="pl-s"><span class="pl-pds">'</span>node<span class="pl-pds">'</span></span>,
  <span class="pl-s"><span class="pl-pds">'</span>/home/fabrice.marsaud/Documents/myScript.js<span class="pl-pds">'</span></span>,
  <span class="pl-s"><span class="pl-pds">'</span>-p<span class="pl-pds">'</span></span>,
  <span class="pl-s"><span class="pl-pds">'</span>abc<span class="pl-pds">'</span></span> ]</pre></div>
<p dir="auto">I have a script which responds to the --debug flag.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="babel-node main.js --debug"><pre class="notranslate"><code class="notranslate">babel-node main.js --debug
</code></pre></div>
<p dir="auto">Right now, it is getting handled by 'babel-node' and not being passed to main.js</p>
<p dir="auto">I think babel-node should only handle arguments that come before the script.</p>