需要: npm 和 nodeJs,我的是通过nvm node版本管理工具安装的 这里不详细说 npm和node 不懂得请看https://my.oschina.net/zhubaoxin/blog/2875153
通过npm安装cnpm模块: npm install -g cnpm
用 create-react-app 快速构建 React 开发环境 create-react-app 是来自于 Facebook,通过该命令我们无需配置就能快速构建 React 开发环境。
create-react-app 自动创建的项目是基于 Webpack + ES6 。
执行以下命令创建项目:
$ cnpm install -g create-react-app
$ create-react-app my-app
$ cd my-app/
$ npm start
注意:这里node 版本需要 8 及以上。
访问本地的 http://localhost:3000/ 即可
使用 create-react-app配合express快速构建React开发环境 https://segmentfault.com/a/1190000009857965