1.安装了babel
但是终端执行 babel src --out-dir build
命令时说“babel:command is not found”
经百度,找到solution——把babel安装在全局环境下(global安装)就好了
疑惑:官网建议local install,为什么呢?我安装在项目里,这不就出问题了么……为什么还不提倡全局安装?
2.照例,先来一发hello world。
<!DOCTYPE html>
<html>
<head>
<script src="./js/react.js"></script>
<script src="./js/react-dom.js"></script>
<script src="./js/browser.min.js"></script>
</head>
<body>
<div id="example"></div>
<script type="text/babel">
ReactDOM.render(
<h1>hello,world</h1>
document.getElementById('example')
)
</script>
</body>
</html>
报错:

原因:
逗号!
