Sergey Bekker
Sergey Bekker

Reputation: 53

Receive error when deploy to GitHub pages

I'm deploy react app to git hub pages and receive error. File sizes after gzip:

68.67 KB  build\static\js\2.c2c334ae.chunk.js
 2.98 KB  build\static\js\main.8a72b1a2.chunk.js
  774 B   build\static\js\runtime~main.8f8a00a4.js

The project was built assuming it is hosted at /sort-customers-list/. You can control this with the homepage field in your package.json.

The build folder is ready to be deployed. To publish it at https://sejob.github.io/sort-customers-list, run: npm run deploy

Find out more about deployment here:

[email protected] deploy 
C:\Users\SeJo\Documents\Code\DEV_HW\sort-customers-list
gh-pages -d build

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.
npm ERR! A complete log of this run can be found in:
npm ERR!    
C:\Users\SeJo\AppData\Roaming\npm-cache\_logs\2019-08-01T12_09_52_445Z-debug.log

Upvotes: 5

Views: 3882

Answers (4)

Hein Soe
Hein Soe

Reputation: 53

use version 2.0.1

npm i [email protected]

Upvotes: 0

SystemX
SystemX

Reputation: 539

INSTALL/REINSTALL GIT Update NPM Reopen EDITOR

this solved my problem

Upvotes: 1

Ismail Ramzan
Ismail Ramzan

Reputation: 68

The problem occurs in the new version of GitHub pages. Just use this command to install the previous version of GitHub pages:

npm install [email protected]

Hope it will help!

Upvotes: 5

user11869607
user11869607

Reputation: 41

I also had this same problem on a fresh install of create-react-app. I have no idea what the problem was, but I did the following:

  1. Downgrade gh-pages from 2.1.0 to 2.0.1
  2. Instead of running npm run deploy, manually run npm run build then gh-pages -d build from the commandline.

At first, I'd get the same error in the commandline, even after checking that the version was downgraded to 2.0.1, but for some reason it worked after manually creating the gh-pages branch and pushing some files into it. As of now, npm run deploy throws the error but at least gh-pages -d build from the console works.

Upvotes: 4

Related Questions