kokc12
kokc12

Reputation: 23

Why I get an error when I try to deploy a react app to GitHub Pages?

I tried to deploy a react app to GitHub pages...

Commands on package.json:

 "predeploy": "npm run build",
 "deploy": "gh-pages -d build",

and received this error:

The "file" argument must be of type string. Received type undefined
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.

It was supposed to deploy.

Upvotes: 2

Views: 167

Answers (1)

Tejas
Tejas

Reputation: 183

I've resolved mine. Newer version 2.1 has some issue. Revert back to 2.0.1.

  • Reinstall Github pages with a specific version:
npm uninstall gh-pages

npm i [email protected]

npm run deploy // as usual

Hope that helped. :)

Upvotes: 1

Related Questions