Reputation: 41
I have been following the react: up and running book by stoyan stephanov. Chapter 5. I am stuck at the command:
babel --presets react,es2015 js/source -d js/build
result: es2015 does not exist.
But when I try: babel --presets react js/source -d js/build
it works as expected in the book.
And then I write: babel --presets react,es2015 js/source -d js/build
result: Syntax error at app.js. Unexpected token before h1 tag.
App.js code
'use strict';
import React from 'react';
import ReactDOM from 'react-dom';
import Logo from './components/Logo';
ReactDOM.render(
<h1>
Welcome to the app!
</h1>,
document.getElementById('app')
);
Upvotes: 0
Views: 120