isaacs/rimraf

Error: glob dependency not found, set `options.disableGlob = true` if intentional

sunil-sandhu opened this issue · 5 comments

Upon executing this.browser.close() to end a puppeteer process, the aforementioned error occurs every time.

From what I can tell, options is defined as an empty object on line 51 of rimraf.js. Is it possible to add some logic into rimraf to check whether the try/catchblock on line 5-9 of rimraf.js successfully requires glob?

One solution would be to add the following into the rimraf function on line 48:

  if(!glob) {
    options.disableGlob = true;
  } 

Faced with the same problem: await browser.close() failed with "glob dependency not found, set options.disableGlob = true if intentional".

Solved by adding glob to production dependencies.

Suddenly running into this issue in multiple repos when running rimraf dist/* with yarn. Works again if running npm install and then trying.

Facing the same issue and @martinstark idea with npm install doesn't work for me.
Any updates?

I've not had time to investigate properly, but I've had less issues in mono-repo setups with yarn by staying on Node 12. YMMV.

Glob dep removed in v4.