【问题标题】:Why do i have error when deploying static project in github pages为什么在github页面中部署静态项目时出现错误
【发布时间】:2022-11-11 18:58:44
【问题描述】:

我已经在 github 页面上部署了我的项目,但是当我在 gh-pages 设置中打开链接时,我有这个页面:

这是我的网址:https://meriemu.github.io/map-mapbox-js/ 以及 Github 存储库:https://github.com/Meriemu/map-mapbox-js

在使用 npm 安装 sass 之前我没有遇到这个问题,所以我不知道问题出在哪里。

这也是我的项目存储库:

我的 package.json :

    {
      "homepage": "https://Meriemu.github.io/map-mapbox-js",
      "name": "map-mapbox",
      "scripts": {
        "deploy": "gh-pages -d build",
        "sass": "sass scss:public",
        "sass:dev": "sass --watch --embed-source-map scss:public/styles",
        "sass:prod": "sass --no-source-map --style compressed scss:public/styles"
      },
      "dependencies": {
        "gh-pages": "^4.0.0"
      },
      "version": "1.0.0",
    ..
    ....
    ..
    .
}

【问题讨论】:

    标签: github sass github-pages


    【解决方案1】:

    如果我访问https://meriemu.github.io/map-mapbox-js/public/,我可以看到您的页面,这是您的index.html 文件所在的位置。

    404 错误页面也解释了这个问题:

    对于根 URL(如 http://example.com/),您必须提供 index.html 文件。

    【讨论】:

      猜你喜欢
      • 2023-01-16
      • 2019-01-27
      • 1970-01-01
      • 2020-12-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-26
      相关资源
      最近更新 更多