看看更新!!
我试图将我的ReactJS页面部署到Github,然后遵循规则来开球。
来自:https://facebook.github.io/create-react-app/docs/deployment和https://medium.freecodecamp.org/surge-vs-github-pages-deploying-a-create-react-app-project-c0ecbf317089
在第一次尝试之后,我在第二次尝试时得到的错误是:
fatal: HttpRequestException encountered.
An error occurred while sending the request.
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': No error
会发生什么事?
编辑:好的,我现在有一个网站,但URL是myname.github.io/myname.github.io。我怎样才能解决这个问题?
https://facebook.github.io/create-react-app/docs/deployment#troubleshooting
取自这里:
尝试添加新的个人访问令牌:
git remote set-url origin https://<user>:<token>@github.com/<user>/<repo>
。再次尝试npm run deploy
=======看到原始问题的添加后编辑。
所以我认为这是一个项目页面...但它是一个github.io页面。在这种情况下,只需将您的应用程序推送到master(build / dist文件夹),如果要在master分支中清理,则将其他所有内容(特别是源代码)移动到其他分支。更多信息:https://pages.github.com/
你遇到了什么https://yourname.github.io/yourproject
是一个项目页面,所以如果你正在构建一个项目,你可以自动将它添加到你的主github页面(你的github.io)。