美文网首页
React Native日常踩坑

React Native日常踩坑

作者: 能吃饭也能吃苦1236 | 来源:发表于2018-09-13 01:04 被阅读0次

npm i安装模块后出错

  • 错误提示


  • 解决办法:删除生成的v7包


npm install -g yarn react-native-cli后执行react-native run-android命令提示“react-native不是内部命令或外部命令”

  • 原因:NodeJs缓存的地址没有设置好


  • 解决办法
    1.使用npm config ls查看npm配置的路径



    2.修改缓存路径



    3.重新执行npm install -g yarn react-native-cli,解决问题

git commit出错

  • 原因:远程分支上更新了代码,git pull的代码与本地的代码有不同的地方
  • 解决办法:检查远程分支pull下来的代码与本地的代码,去掉不同的地方,一般以最新的那个版本为主

git分支操作

  • git分支基本命令
git add ..
git commit -m "update"
git pull
git push
git branch <name> /*创建分支*/
git branch  /*查看本地所在分支*/
git branch -a  /*查看远程仓库所有分支*/
git checkout <name> /*切换分支*/
git checkout -b <name> /*创建+切换分支*/
git merge <name> /*合并某分支到当前分支*/
git branch -d <name> /*删除分支*/
  • webstorm git分支操作
    webstorm自带了git命令插件,可以直接使用,不用输命令,个人理解的分支操作为:
    (1)首先要新建一个自己的分支,并且在本地切换为自己的分支;
    (2)将自己缩写的代码git commit到自己的分支;
    (3)由本地分支git push到自己的远程分支;
    (4)最后将自己的代码请求合并到主分支。
  • 注意
    (1)如果远程代码有更新,需要需要先git pull到本地才能再次提交代码。
    (2)每次从远程分支git pull代码后先npm i安装模块再运行。

npm install 报错(npm ERR! errno -4048,Error: EPERM: operation not permitted,)解决方法参考网址

运行命令
npm cache clean --force

撤销merge

$ git reset --hard HEAD (or sha_1)  
git commit --no-verify -m "修改"

Android Studio Rebuild失败:Could not find com.android.tools.lint:lint-gradle:26.1.1.参考链接

相关文章

网友评论

      本文标题:React Native日常踩坑

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