tschaub/gh-pages

npm run deploy looping

Soran-i opened this issue · 3 comments

I created a fresh create-react-app and added gh-pages to it. I go ahead and run

npm run deploy

and then I get this:

`npm run deploy

sorani.tech@0.1.0 predeploy
npm run deploy

sorani.tech@0.1.0 predeploy
npm run deploy

sorani.tech@0.1.0 predeploy
npm run deploy

sorani.tech@0.1.0 predeploy
npm run deploy

sorani.tech@0.1.0 predeploy
npm run deploy

sorani.tech@0.1.0 predeploy
npm run deploy

sorani.tech@0.1.0 predeploy
npm run deploy

sorani.tech@0.1.0 predeploy
npm run deploy

sorani.tech@0.1.0 predeploy
npm run deploy

sorani.tech@0.1.0 predeploy
npm run deploy

sorani.tech@0.1.0 predeploy
npm run deploy

sorani.tech@0.1.0 predeploy
npm run deploy

sorani.tech@0.1.0 predeploy
npm run deploy

sorani.tech@0.1.0 predeploy
npm run deploy

sorani.tech@0.1.0 predeploy
npm run deploy

sorani.tech@0.1.0 predeploy
npm run deploy

sorani.tech@0.1.0 predeploy
npm run deploy

sorani.tech@0.1.0 predeploy
npm run deploy

sorani.tech@0.1.0 predeploy
npm run deploy

sorani.tech@0.1.0 predeploy
npm run deploy

sorani.tech@0.1.0 predeploy
npm run deploy

sorani.tech@0.1.0 predeploy
npm run deploy

'npm' is not recognized as an internal or external command,
operable program or batch file.`

I am not sure why this is happening...

Does the your package.json have a predeploy that runs deploy?

I had the same Issue please check your package.json and see if your scripts are in the right order

Here was what i had that caused the issue

"scripts": {
"predeploy": "npm run deploy", <-----------
"deploy": "gh-pages -d build",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"

Changing that word to the correct word "build" caused it to deploy correctly
additionally I had issues when the scripts were not in the correct order

"scripts": {
"start": "react-scripts start",
"predeploy": "npm run build", <-----------
"deploy": "gh-pages -d build",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"

The code that fixed my issue was this

"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"

I hope that helps!

I'm guessing that this issue can be closed