In short, using the throwIfNoEntry option will cause statSync to return undefined instead of throwing. This causes the checks in statFixSync for uid/gid to throw because stats can be null. Simple fix (which I will make a PR for) is to just check for stat existence
Friendly ping on this one @isaacs - trying to push the use of this option into some other tools, so want to make sure this upstream fix is available first
In short, using the
throwIfNoEntry
option will cause statSync to return undefined instead of throwing. This causes the checks in statFixSync for uid/gid to throw because stats can be null. Simple fix (which I will make a PR for) is to just check for stat existencehttps://nodejs.org/dist/latest-v16.x/docs/api/fs.html#fsstatsyncpath-options
cc @isaacs