Accepted answer

Seems like a bug in gh-pages 2.1.

I solved mine by downgrading gh-pages to version 2.0:

yarn add gh-pages@2.0 -D` // or

npm install -D gh-pages@2.0


Whenever you start your program, you use npm start. This can be used for Deploy too. Instead of doing npm run deploy, the command should be npm deploy.


Update: Fixed in gh-pages@2.1.1. You can now update your gh-pages package to latest version to fix this.

npm i gh-pages@latest

If you don't wish to downgrade to version 2.0.1, the workaround is to instead of using "deploy": "gh-pages -d build" as your deploy script, use:

"deploy": "gh-pages -d build --git git"

This somehow fixes the problem.

You can find the GitHub issue about this bug here: tschaub/gh-pages#308

Related Query

More Query from same tag