gh-pages: The "file" argument must be of type string. Received type undefined

I have a directory dist/, when I run gh-pages --dist dist from my package.json, I get this error:

The "file" argument must be of type string. Received type undefined

node: v12.7.0
Ubuntu (Pop!_OS 19.04)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 19
  • Comments: 22 (1 by maintainers)

Commits related to this issue

Most upvoted comments

Adding --git "$(which git)" to the args I pass gh-pages works around this issue.

@AffiliateThis Guessing you tried it already, but if you haven’t: -Delete node_modules -Delete package-lock file -In package.json -> dependencies -> delete gh-pages line

run npm i gh-pages@2.0.1 run npm i try again.

@BjornoWalker also, if you don’t want to hardcode the git path, you can use --git git as git is in PATH by default on most systems including Windows, OR you can downgrade to gh-pages@2.0.1

The gh-pages@2.1.1 release includes a fix for this.

Downgrading to 2.0.1 works.

Thanks a lot, I was finally able to get it to work thanks to your advice! I’m going to keep looking into creating the reusable npm script also.