在 github 上部署我的 React 应用程序

Deploying my react app on github

我有一个 master 分支和 gh-pages。

当我的一位开发人员朋友带我浏览它时,我能够在 gh-pages 上看到它。

我试图将 gh-pages 与 master 合并以添加我所做的样式,但它弄乱了 github 的可见应用程序页面。

"scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject",
    "precommit": "lint-staged",
    "build": "node build.js", 
    "deploy": "npm run build && git-directory-deploy --directory _build/"
  },
  "homepage": "https://marianapt.github.io/reduxTable/",
  "lint-staged": {
    "*.{js,json,css,md}": ["prettier --write", "git add"]
  }

那是我的 package.json

我执行 npm install 以确保其全部更新..

自从我合并了 master 和 gh-pages 后,我就看不到我的应用程序,我又回到了自述文件页面。 https://marianapt.github.io/reduxTable/ 那就是 link...

我不明白你到底发生了什么,但我认为问题是你在合并时丢失了 master 分支的产品 app.js。 只需尝试 运行 npm run build 并再次推送到 github 希望对你有帮助。