$ npm install --save gh-pages
OR
npm install gh-pages --save-dev
"homepage": "https://<github-username>.github.io/<github-repo-name>/",
"scripts": {
...
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
...
},
$ npm run deploy
- If you get the error
fatal: A branch named 'gh-pages' already exists
, try:
rm -rf node_modules/gh-pages/.cache