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

See original GitHub issue

I’m currently getting this error when I try to use gh-pages:

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

There’s a previous issue that’s similar to this (#308) and I saw that it was already fixed in the latest versions. I’m currently using gh-pages@2.2.0. My node version is v12.7.0 and my npm version is 6.10.0.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:21
  • Comments:11

github_iconTop GitHub Comments

27reactions
ardieordencommented, May 24, 2020

Is anyone else getting the same error?

13reactions
brpazcommented, Aug 16, 2020

I am getting the same error. I dived into the code and I think I found the issue.

It´s on index.js:116.

  const clone = path.join(getCacheDir(), filenamify(repo));

The getCacheDir returns undefined in my case. Diving deeper, I found out it uses the find-cache-dir package, which has the following comment on the code:

Finds the cache directory using the supplied options.
 * The algorithm tries to find a `package.json` file, searching every parent directory of the `cwd` specified
 * (or implied from other options). It returns a `string` containing the absolute path to the cache directory,
 * or `undefined` if `package.json` was never found or if the `node_modules` directory is unwritable.

I don’t have a package.json file in my project. that´s why I think I am getting undefined.

This only happens on 3.1.0. 3.0.0 works fine,

Read more comments on GitHub >

github_iconTop Results From Across the Web

The "path" argument must be of type string ... - Stack Overflow
I'm working on a project in React and ran into a problem that has me stumped. Whenever I run yarn start I get...
Read more >
[Fix] TypeError [ERR_INVALID_ARG_TYPE]: The “path ...
Have you run into the error “TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string. Received undefined”? In this story I'll go...
Read more >
The "path" argument must be of type string. Received - YouTube
JavaScript : TypeError [ERR_INVALID_ARG_TYPE]: The "path " argument must be of type string. Received type undefined raised when starting ...
Read more >
typeerror [err_invalid_arg_type]: the "path" argument must be ...
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined raised when starting react app.
Read more >
Avoid strange error 'The "path" argument must be of type string ...
Received null', when fthe path is not null - Salesforce Stack Exchange ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found