react

1、安装

安装react

sudo npm install -g create-react-app

试着生成一个react的项目

create-react-app zss

会提示缺少node

sudo apt-get install nodejs

apt的node默认版本过低,需要安装8.x以上(使用sudo apt-get install nodejs=9.11.2无效)

curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt-get install -y nodejs

2、创建webpack项目

node9 安装好之后,执行创建webpack项目的命令

cerate-react-app zss

create-react-app命令执行完成之后,会产生如下提示

按照提示,执行npm start可以执行该项目,运行web服务。

原文地址:https://www.cnblogs.com/zealousness/p/10389730.html