react简书笔记一 环境, git 和 项目 关联

1.. 建立git项目  ( 码云, github 都可以 ), 具体步骤: https://www.cnblogs.com/andy-lehhaxm/p/10720717.html

  1.1  git 和  项目 关联:  git   remote   add  origin   gti@gitee.com/CMCC_10086/reactJianShu.git  ( git  remote add  origin  单词顺序不能错 )

  1.2  再 git  add  . --> git  commit -m '' --> git push  

  1.3  git  push  提示错误  reject 时,   需要手动消除差异 https://www.cnblogs.com/andy-lehhaxm/p/10787996.html

      git pull origin master --allow-unrelated-histories //把远程仓库和本地同步,消除差异,  需要重新add .  提交  push

2.. 通过react脚手架工具, 创建初始化本项目    ( 项目名不能有大写字母 )

  2.1 先安装脚手架:   npm  install -g  create-react-app

  2.2 使用脚手架建立项目:   create-react-app   myProgramName

  ( 或者--react官方--2.3  或者用  npx create-react-app  myProgramName       https://reactjs.org/docs/create-a-new-react-app.html )

    npx 是node>=6, 且 npm>=5.2 新引入的命令

npx create-react-app my-app
cd my-app
npm start
React官方Create New React App
原文地址:https://www.cnblogs.com/andy-lehhaxm/p/10787243.html