Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gh-pages -d build gives Error "file" argument must be a non-empty string

I included all the steps for deploying my create react app on github. snippet of my package.json

"scripts": {
    "start": "node scripts/start.js",
    "build": "node scripts/build.js",`enter code here`
    "test": "node scripts/test.js",
    "homepage": "http://myName.github.io/create-react-wars",
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build"
},

this is the error i am getting

gh-pages -d build
"file" argument must be a non-empty string
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Jishu\AppData\Roaming\npm-cache\_logs\2019-08-02T17_13_43_435Z-debug.log
like image 757
Jishan Avatar asked Oct 16 '22 12:10

Jishan


1 Answers

Got the same issue; this answer solved my problem: https://stackoverflow.com/a/57315930/11879312

"Seems like a bug in gh-pages 2.1. I solved mine by downgrading gh-pages to version 2.0: yarn add [email protected] -D or npm install [email protected] --dev."

like image 108
Justin J Avatar answered Nov 14 '22 00:11

Justin J