2023-11-27
2779
#react
Nelson Michael
127590
Nov 27, 2023 ⋅ 9 min read

Deploying React apps to GitHub Pages

Nelson Michael Nelson Michael is a frontend developer from Nigeria. When he's not meddling with CSS, he spends his time writing, sharing what he knows, and playing games.

Recent posts:

Mastering charts and database visualization with ChartDB

ChartDB is a powerful tool designed to simplify and enhance the process of visualizing complex databases. Explore how to get started with ChartDB to enhance your data storytelling.

David Omotayo
Jan 3, 2025 ⋅ 7 min read
JavaScript icon over teal background.

JavaScript scroll snap events for scroll-triggered animations

Learn how to use JavaScript scroll snap events for dynamic scroll-triggered animations, enhancing user experience seamlessly.

Abiola Farounbi
Jan 2, 2025 ⋅ 7 min read

Understanding deep linking in React Native

A comprehensive guide to deep linking in React Native for iOS 14+ and Android 11.x, including a step-by-step tutorial.

Eugene Hauptmann
Dec 31, 2024 ⋅ 9 min read
React logo over lavender background

How React 19 can help you make faster websites

Explore React 19’s new features, including the compiler, automatic memoization, and updates to hooks like use() and useFormStatus.

Emmanuel Odioko
Dec 31, 2024 ⋅ 12 min read
View all posts

14 Replies to "Deploying React apps to GitHub Pages"

  1. “gh-pages-d build”, there is a space in -d. if you would not add space you can get message that “‘gh-pages-d’ is not recognized as an internal or external command,
    operable program or batch file. ”
    should be like this
    “deploy”: “gh-pages -d build”

  2. Thank you for putting everything very well. I could easily go through the steps and got the deploying done. A big thank you

  3. Hi Michael, thank for posting this. I’m getting an error near the beginning.
    npm install gh-pages –save-dev

    Unsupported engine {
    npm WARN EBADENGINE package: ‘@csstools/[email protected]’,
    npm WARN EBADENGINE required: { node: ‘^14 || ^16 || >=18’ },
    npm WARN EBADENGINE current: { node: ‘v17.9.1’, npm: ‘8.11.0’ }

    I think this is connected to problems I’m having using the command line to manage my repository on github… but maybe I fixed that and this is a new problem…?

    Also, I’d like to subscribe to your blog, but I’m not sure what logrocket is and how to subscribe without paying a membership fee.

  4. When I try this, I end up with an empty page that just says “This site is open source. Improve this page.”

    I looked at the `artifact.zip` file that the ci built, and it appears to have created this index.html with just that content in it at the top level.

    My project runs just fine locally with `npm run start` for example.

    Any idea why this would happen?

    1. In my case I had forgot to add the homepage property in the package.json.

      “In the package.json file, add a homepage property that follows this structure: http://{github-username}.github.io/{repo-name}.”

Leave a Reply