首页 > 解决方案 > 我正在使用 gh-pages 来部署一个 github 页面,但是当它之前工作正常时我现在遇到了一个错误

问题描述

在我的 package.json 中,我有正确的主页。我安装了 gh-pages 并添加了这两个脚本

"predeploy": "npm run build",
"deploy": "gh-pages -d build"

这是终端中显示的所有内容

git-upload-pack '.': git-upload-pack: command not found
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! portfolio@0.1.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the portfolio@0.1.0 deploy 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!     C:\Users\Austin\AppData\Roaming\npm-cache\_logs\2020-01-31T04_47_04_970Z-debug.log

可能是什么问题,我该如何解决?谢谢您的帮助!

标签: reactjsgithubdeploymentgithub-pages

解决方案


我实际上能够通过安装最新版本的 Node.js 来解决这个问题。这解决了一切,谢谢!


推荐阅读