0

我正在尝试将 Angular PWA 部署到 gh 页面并在部署时收到此错误:git-upload-pack '.': git-upload-pack: command not found fatal: could not read from remote repository。

请确保您具有正确的访问权限并且存储库存在。

我的脚本是:

"scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test",
    "start-pwa": "ng build --prod && http-server -p 8080 -c-1 dist/billFold-client",
    "predeploy": "ng build --prod --base-href=/billFold-client/",
    "deploy": "npx gh-pages -d dist/billFold-client"
  },
  "private": true,
  "homepage": "https://gcy2312.github.io/billFold",

有没有人能够解决这个问题?我试过改变我的脚本,改用 angular-cli-ghpages ......总是同样的错误......

4

1 回答 1

0

似乎角度部署很棘手 - 有时他们不会简单地创建 gh-pages 并且它不存在:改为运行这些脚本:安装 angular-cli-ghpages:npm install -g angular-cli-ghpages 创建 gh-pages 分支:git branch gh-pages 设置为新的 gh-pages 分支:git checkout -b gh-pages 构建应用程序:ng build --prod --base-href https://githubUsername.github.io/repositoryName 部署:ngh --dir=dist/projectName

于 2022-02-06T19:38:35.947 回答