美文网首页
React 安装

React 安装

作者: 老95 | 来源:发表于2018-05-23 10:05 被阅读0次

    React快速搭建
    1、node、Git相应的环境基础,最好安装淘宝镜像
    淘宝镜像:

          $ npm install -g cnpm --registry=https://registry.npm.taobao.org  
          $ npm config set registry https://registry.npm.taobao.org
    

    2、使用 create-react-app 快速构建 React 开发环境
    create-react-app 是来自于 Facebook,通过该命令我们无需配置就能快速构建 React 开发环境。
    create-react-app 自动创建的项目是基于 Webpack + ES6 。

          $ sudo cnpm install -g react-native-cli(整个电脑全局安装一次就可以,再次创建新项目的话,直接从第二条命令开始执行)
          $ sudo cnpm install -g create-react-app  
          $ create-react-app my-app (创建文件夹为my-app的项目)  
          $ cd my-app/  
          $ cnpm start  
    

    注释:
    命令前加上sudo会要求输入Password,Password是该电脑的开机密码。

    相关文章

      网友评论

          本文标题:React 安装

          本文链接:https://www.haomeiwen.com/subject/fxnljftx.html