Reputation: 1244
I am trying basic example in React.JS and using Babel to transpile from jsx to js. I hope I installed all babel dependencies, shown in package.json below. Also added App.jsx and index.html pages.
As shown in line 8 of package.json, I am trying to execute babel with "npm run build" but it is throwing error as shown in this terminal screenshot.
Any help appreciated.
Upvotes: 1
Views: 1091
Reputation: 203534
This happens when you don't configure Babel (properly).
Add this to your package.json
:
"babel" : {
"presets": ["es2015", "react" ]
}
More information here.
Upvotes: 3