安装react
npm install -g create-react-app //安装脚手架
create-react-app my-app //创建项目
遇到的问题:An unexpected error occurred: “http://registry.cnpmjs.org/react: Hostname/IP does not match certificate’s altnames: Host: registry.cnpmjs.org. is not in the cert’s altnames: DNS:r.cnpmjs.org”.
问题解决:npm config set registry http://registry.npmjs.org/
my-app cd my-app //进入my-app项目
npm start //启动项目