将React App部署到GitHub页面:找不到404页面

时间:2019-09-28 20:08:34

标签: reactjs github

我已经在本地机器上使用React App了数周了。我在GitHub上有一个项目的存储库,我正在尝试将该应用程序部署到GitHub Pages,以便我可以共享该项目的实时版本。

我已经阅读了几本教程,并且在设置过程中一切正常;但是,该链接将我带到了一个空白的404页面。

到目前为止,我已经添加了gh-pages作为依赖项并运行了npm run deploy and build commands。我还添加了主页脚本标签,没有任何问题。运行命令后,该站点将发布,但不会生效。

https://silvodesigns.github.io/MemoryGame/

  "name": "game",
  "version": "0.1.0",
  "private": true,
  "homepage": " https://silvodesigns.github.io/MemoryGame/",
  "dependencies": {
    "gh-pages": "^2.1.1",
    "normalize.css": "^8.0.1",
    "pretty-ms": "^5.0.0",
    "react": "^16.9.0",
    "react-dom": "^16.9.0",
    "react-scripts": "3.1.1"
  },
  "scripts": {
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build",
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}```






0 个答案:

没有答案