Jishan
Jishan

Reputation: 61

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

Upvotes: 5

Views: 460

Answers (2)

Justin J
Justin J

Reputation: 31

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

Upvotes: 3

doc-han
doc-han

Reputation: 736

I think the command is like this.

gatsby -d public -b master

Where public is the folder you want to push and master is the branch you want to push to. Please run your build before this

Upvotes: 0

Related Questions