-
-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Path *** is not in cwd *** #133
Comments
I'm seeing this error too, when trying to use an glob containing an absolute Absolute temp dir paths are very useful in tests. |
#137 fixes at least some of the scenarios where this error is being thrown, though it isn't clear if it is all of them. |
@fjc0k Can you try out https://github.com/sindresorhus/globby/releases/tag/v10.0.2 and let us know if that fixes your issue? |
@sindresorhus No, always the same error for each version:
|
I'm also seeing a version of this issue. In my case, it seems to be caused by my being on Windows, so the absolute path being checked and the cwd are not in the same format. That means using The error I'm getting:
|
I opened a PR to at least solve the issue in Windows I was seeing: I'm not sure if it helps with other use cases, too. |
@jaydenseric did you ever get around this error? (I know I'm asking a whole year late :P) |
@navoneel07 I can't remember anything about this problem, sorry! |
I just encountered this error on |
It could be a solution. // gitignore.js#48
const ensureAbsolutePathForCwd = (cwd, p) => {
+ p = path.normalize(p);
cwd = slash(cwd);
if (path.isAbsolute(p)) {
if (p.startsWith(cwd)) {
return p;
}
throw new Error(`Path ${p} is not in cwd ${cwd}`);
}
return path.join(cwd, p);
}; |
@sindresorhus Hi! P.S. I am using ^11 as I cannot depend on a pure ESM module, yet. I hope you publish a bugfix version for 11 as well. Maintaining the last CJS version and the latest ESM version simultaneously would be great for people who really cannot move on to ESM right now for a while. |
|
Just running this code:
Then you will get an error:
But if you set
gitignore
tofalse
, all works well.After a bit of investigation, most likely it is caused by this PR: #120
The text was updated successfully, but these errors were encountered: