将网站部署到Github页面后,URL出现严重问题,我不确定如何解决

时间:2019-04-14 20:51:58

标签: reactjs github github-pages

请参阅更新!

我试图将我的ReactJS页面部署到Github,然后将规则遵循到tee。

两者均来自:https://facebook.github.io/create-react-app/docs/deploymenthttps://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。我该如何解决?

1 个答案:

答案 0 :(得分:0)

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分支中进行清理,则只需将您的应用程序推送到master(build / dist文件夹),然后将其他所有内容(尤其是源文件)移至其他分支。更多信息:https://pages.github.com/

您遇到的https://yourname.github.io/yourproject是一个项目页面,因此,如果您正在构建一个项目,则可以将其自动添加到您的主要github页面(您的github.io)中。