title: babel-node cannot find module - interpreting presets options as a filename?
body: <p>I'm calling this command:</p>
  
  <pre><code>$ babel-node --presets react,es2015 server.js
  </code></pre>
  
  <p>but instead of running node and using Babel with the react and es2015 presets, I get this error:</p>
  
  <pre><code> Cannot find module 'C:\websites\rgrjs\react,es2015'
      at Function.Module._resolveFilename (module.js:326:15)
      at Function.Module._load (module.js:277:25)
      at Function.Module.runMain (module.js:430:10)
      at Object.&lt;anonymous&gt; (C:\Users\Tom\AppData\Roaming\npm\node_modules\babel\lib\_babel-node.js:144:25)
      at Module._compile (module.js:398:26)
      at Object.Module._extensions..js (module.js:405:10)
      at Module.load (module.js:344:32)
      at Function.Module._load (module.js:301:12)
      at Function.Module.runMain (module.js:430:10)
      at startup (node.js:141:18)
  </code></pre>
  
  <p>That seems to suggest that node is interpreting the <code>react,es2015</code> parameters as a file instead of parameters for the presets option?  How can I fix that?</p>
  
  <p>The <a href="https://babeljs.io/docs/usage/cli/#usage" rel="nofollow noreferrer">Babel documentation for <code>babel-node</code></a> seems to use the same syntax as above?  I've tried adding <code>--</code> before the file name but that didn't help.</p>
  
  <p>I'm pretty new to React and Node and am working through a course at the moment, so apologies if this is something blindingly obvious.</p>
  
  <p>These are the dependencies in my package.json file:</p>
  
  <pre><code>  "dependencies": {
      "babel": "^6.3.26",
      "babel-cli": "^6.4.0",
      "babel-core": "^6.4.0",
      "babel-loader": "^6.2.1",
      "babel-preset-es2015": "^6.3.13",
      "babel-preset-react": "^6.3.13",
      "express": "^4.13.3",
      "react": "^0.14.3",
      "react-dom": "^0.14.3",
      "webpack": "^1.12.9"
    },
  </code></pre>
  
  <p><strong>Edit</strong>
  As well as the accepted answer, it's also possible that this issue was down to my global version of babel being different to the project version and my not understanding which one node is using.</p>