加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

快速创建React apps

发布时间:2020-12-15 03:25:11 所属栏目:百科 来源:网络整理
导读:可能你在入门的时候,需要装各种npm包,例如:browser webpack react react-dom babel等等。 现在只需要2分钟,快速搭建环境: npm install -g creat-react-app 安装完成后,创建工程 create-react-app 项目名 完成 ~ 切换到demo目录下,执行npm start。启动

可能你在入门的时候,需要装各种npm包,例如:browser webpack react react-dom babel等等。

现在只需要2分钟,快速搭建环境:

npm install -g creat-react-app

安装完成后,创建工程

create-react-app 项目名

完成 ~

切换到demo目录下,执行npm start。启动web server

备注:

* npm start: Starts the development server.
  * npm run build: Bundles the app into static files for production.
  * npm run eject: Removes this tool. If you do this,you can’t go back!

如果无法使用creat-react-app命令,则需要

在.bashrc or ~/.zshrc添加
export PATH=$PATH:./node_modules/.bin

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读