isaacs / rimraf

A `rm -rf` util for nodejs
ISC License
5.66k stars 252 forks source link

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

Closed sunil-sandhu closed 1 year ago

sunil-sandhu commented 4 years ago

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;
  } 
Petr-Alexeev commented 3 years ago

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.

martinstark commented 3 years ago

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

Osiris-Team commented 3 years ago

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

martinstark commented 3 years ago

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.

isaacs commented 1 year ago

Glob dep removed in v4.