React on Github Pages: gh-pages package not working React on Github Pages: gh-pages package not working reactjs reactjs

React on Github Pages: gh-pages package not working


You need to install gh-pages globally by adding "-g":

npm install -g gh-pages --save-dev

and then

npm run deploy

Docs: https://devdocs.io/npm/getting-started/installing-npm-packages-globally


You need install gh-pages before running deploy, run:

npm install --save-dev gh-pages thennpm run deploy


I cannot add a comment to this post, because I don't have enough score. But there is an error in the your package.json code:

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

Because, there is an extra semicolon :. It should be:

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