Creat React App deploy on GitHub

在将本地的react项目部署到GitHub上时,除了官方文档上介绍的那几步外,可能还会出现下面的两个错误。

  1. Failed to get remote.origin.url (task must either be run in a git repository with a configured origin remote or must be configured with the “repo” option).

解决办法:没有和远程仓库链接。可以用git remote来查看一下是否为空,若为空,需要用git remote add origin ...来添加远程仓库

  1. fatal: A branch named ‘gh-pages’ already exists.

解决办法:缓存中已经存在‘gh-pages’分支。解决办法需要将分支从缓存中删除,可以使用rm -rf node_modules/gh-pages/.cache,也可以直接去删除node_modules/gh-pages/.cache文件夹

参考资料:https://github.com/transitive-bullshit/react-modern-library-boilerplate/issues/15
https://github.com/tschaub/gh-pages/issues/192

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值