Closed rchoudhary closed 7 years ago
Same here.
I get this error to
Happening for me as well.
Globbing with **\*
C:\Users\paulr\node_modules\micromatch\lib\utils.js:66
return fp.split('\\').join('/');
^
TypeError: fp.split is not a function
at Object.unixify (C:\Users\paulr\node_modules\micromatch\lib\utils.js:66:15)
at Function.any (C:\Users\paulr\node_modules\micromatch\index.js:231:14)
at isMatch (C:\Users\paulr\node_modules\glob-fs-gitignore\index.js:16:17)
at Object.gitignore (C:\Users\paulr\node_modules\glob-fs-gitignore\index.js:32:9)
at Handler.handle (C:\Users\paulr\node_modules\glob-fs\lib\handler.js:26:17)
at Object.Emitter.handle (C:\Users\paulr\node_modules\glob-fs\index.js:249:18)
at C:\Users\paulr\node_modules\glob-fs\lib\iterators.js:168:20
at C:\Users\paulr\node_modules\glob-fs\lib\symlinks.js:28:18
at FSReqWrap.oncomplete (fs.js:123:15)
Yes It works ok on linux and mac, but not on windows. Im getting this exact error when performing any search.
on the setPattern function at index.js of the lib
change from // if middleware are registered, use the glob, otherwise regex var glob = this.fns.length ? this.pattern.glob : this.pattern.re;
to
// if middleware are registered, use the glob, otherwise regex
var glob = this.fns.length
? this.pattern.glob
: this.pattern.regex;
this seems to fix the prob
sorry all, I think I mentioned this elsewhere but this might be fixed by updating micromatch to the latest version. I can do this when I have a chance, or if someone wants to do a pr I'd be happy to merge
Updating micromatch resulted same issue.
+1 for this issue :(
I am getting the same error. This looks like a great library, more flexible than https://github.com/isaacs/node-glob, but it just doesn't work on Windows for a lot of people. Any chance of getting this fixed?
@octachrome, please see the very top of the front page of the project where it states ... This library is experimental and does not work on windows!
Any chance of getting this fixed?
We're going to do a complete refactor of this lib as soon as we have a chance. I'm not sure when that will be, but I'll make sure to publish the refactor on the dev
branch and post an update here as soon as it's started
It's exactly what @setriosdomain suggested above. It's just a typo pattern.re is undefined it is supposed to be pattern.regex
@itslenny if you want to do a pr, I'll merge it in right away. That would make it a lot easier for me to get to this. Otherwise it might be a while
I just tried it, but the issue seems to cascade a bit, and I'm honestly not sure where the rabbit hole ends.
When it gets the pattern correctly it winds up passing an array into gitignore instead of a string that gets passed to minimatch which calls .split
on an array and crashes.
I updated the minimatch version which fixes that, but then I get an expected string error from normalize-path
which is a sub-dependency of minimatch.
I just tried it, but the issue seems to cascade a bit, and I'm honestly not sure where the rabbit hole ends.
Oh ok, you said "It's exactly what @setriosdomain suggested above. It's just a typo pattern.re is undefined it is supposed to be pattern.regex", so I thought you knew something I didn't. Thanks for clarifying.
How about adding a note on npmjs.com that this does not work on windows...
I submitted a PR for this: https://github.com/micromatch/glob-fs/compare/master...lotekmedia:master It definitely works on Windows now. Thanks!
resolved by https://github.com/micromatch/glob-fs/pull/20
When trying to run the sync example from the website, I get the following error:
For reference, here is the code:
My hunch is it involves line 74 of glob-fs/lib/pattern.js:
this.base = path.join(this.cwd, this.parent);
. Running the debugger, thepath.join
returns a nonsense path (the c:/ drive is in boththis.cwd
andthis.parent
andpath.join
just smashes them together).Even if I fix the issue of
this.pattern.re
vsthis.pattern.regex
, I still get the same 'fp is undefined' error.