My Project Structure (src folder contains react component classes using jsx syntax):
root
- src/
- package.json
- webpack.config.js
The command I am trying to run: babel src --out-dir lib
Unfortunately, I encountered the following error:
SyntaxError: src/node_modules/babel-runtime/helpers/typeof-react-element.js: Unexpected token (5:62)
3 | var _Symbol = require("babel-runtime/core-js/symbol")["default"];
4 |
> 5 | exports["default"] = typeof _Symbol === "function" && _Symbol."for" && _Symbol."for"("react.element") || 60103;
| ^
6 | exports.__esModule = true;
npm ERR! Darwin 15.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build:lib"
npm ERR! node v5.7.1
npm ERR! npm v3.6.0
npm ERR! code ELIFECYCLE
npm ERR! <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="02766b6f6067702f776b42322c322c33">[email protected]</a> build:lib: `babel src --out-dir lib`
npm ERR! Exit status 1
These are my main babel devDependencies (excluding plugins)
"babel-cli": "^6.7.7",
"babel-core": "^6.7.7",
"babel-loader": "^6.2.4",
Could this issue be a bug in babel? Do I need a different version of node or dependency? Any advice on how to resolve this would be greatly appreciated.