1
votes

I'm getting an error when trying to deploy a create-react-app to GitHub pages

Enabled gh-pages in repo's settings, installed gh-pages dependencies, added scripts to package.json

This is the repo: https://github.com/pablowbk/react-swapi-app

This is how my package.json file looks:

    {
      "name": "swapiapp",
      "version": "0.1.0",
      "private": true,
      "homepage": "https://pablowbk.github.io/react-swapi-app/",
      "dependencies": {
        "react": "^16.6.3",
        "react-dom": "^16.6.3",
        "react-scripts": "^2.1.3"
      },
      "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"
      },
      ..., //shortened for posting
      "devDependencies": {
        "gh-pages": "^2.0.1"
      }
    }

and when I run "npm run deploy":

link to screenshot -> npm run deploy error (can't post imgs yet, sorry...)

1
You sure your repo isn't private?Colin Ricardo
How would I go about changing that?Pablo WBK
In the settings for the repo on GitHub, you can set it to private / public.Colin Ricardo
Seems to be public. This is what I get in settings:Pablo WBK
Make this repository private Please upgrade your plan to make this repository privatePablo WBK

1 Answers

0
votes

The error seems to be from the nature of your git project. Its complaining that your project is a shallow repository. Please fix that first & try. Read more about shallow repository.