【问题标题】:Could not read from a remote repository when publishing my site发布我的网站时无法从远程存储库中读取
【发布时间】:2019-08-08 13:52:44
【问题描述】:

我正在使用 docusaurus 为产品编写文档网站。我对该站点进行了一些自定义,并尝试将其发布到 GitHub 上。

按照教程,我配置 website/siteConfig.js,运行 npm run build 并使用:

$ GIT_USER=<GIT_USER> CURRENT_BRANCH=master USE_SSH=true npm run publish-gh-pages

将其推送到 Github。克隆到 gh-pages 失败并显示“致命:无法从远程存储库读取”。错误。

以下 git 命令是我使用的。

LM-SHC-16507799:website benshi$ ls

README.md   core        node_modules    sidebars.json   yarn.lock
blog        git     package.json    siteConfig.js
build       i18n        pages       static
LM-SHC-16507799:website benshi$ pwd

/Users/user_name/Desktop/calender/week_3/docusaurus-exp/website

LM-SHC-16507799:website user_name$ GIT_USER=my_github_user_name CURRENT_BRANCH=master USE_SSH=true npm run publish-gh-pages

失败了。显示了以下错误消息。

> @ publish-gh-pages /Users/user_name/Desktop/calender/week_3/docusaurus-exp/website
> docusaurus-publish

master
https://github.com/my_github_user_name/docusaurus-exp.git
generate.js triggered...
feed.js triggered...
feed.js triggered...
sitemap.js triggered...
Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.
Site built successfully. Generated files in 'build' folder.
89b1f1bd2f7e2403a08a194a89379916edcbb540
Cloning into 'docusaurus-exp-gh-pages'...
ssh_exchange_identification: read: Operation timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Error: git clone failed
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ publish-gh-pages: `docusaurus-publish`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ publish-gh-pages script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/user_name/.npm/_logs/2019-07-18T07_15_37_998Z-debug.log

【问题讨论】:

标签: reactjs git github github-pages docusaurus


【解决方案1】:

这个问题确实与 Docusaurus 无关。

当我尝试使用USE_SSH=true 发布站点 tp gh-pages branch 时,错误是造成的。事实上,我没有在这台机器上存储 SSH。该问题已通过移除此参数(或设置USE_SSH=false)解决。

【讨论】:

    猜你喜欢
    • 2013-04-13
    • 2013-03-14
    • 2018-12-10
    • 2019-01-03
    • 2014-11-25
    • 2020-11-03
    • 2016-09-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多