johnagan / clean-webpack-plugin

A webpack plugin to remove your build folder(s) before building
MIT License
1.96k stars 135 forks source link

Win10 x64 - Dist does not get deleted - ENOENT #78

Closed Legends closed 5 years ago

Legends commented 6 years ago

I am using webpack4 and clean-webpack-plugin v0.1.19 Same configuration as in my webpack3 project. It works in webpack3 project but not anymore in v4.

rimraf.js

 try {
      var st = options.lstatSync(p)
    } catch (er) {
      if (er.code === "ENOENT")  // <-- hitting 
        return
happystory commented 6 years ago

I have the same problem, it doesn't work in webpack4.

Legends commented 6 years ago

I totally forgot that I have opened this issue, but I don't have this issue anymore... don't ask me ...

jensdc92 commented 6 years ago

I'm facing the same problem. Path is correct and in verbose mode it says it deleted the folder, but it's not.

HideoKun commented 6 years ago

same here :(

Error: ENOTEMPTY: directory not empty, rmdir '/Users/nomad/Documents/sun/front-end/build' at Object.fs.rmdirSync (fs.js:853:18) at rmkidsSync (/Users/nomad/Documents/sun/front-end/node_modules/rimraf/rimraf.js:356:25) at rmdirSync (/Users/nomad/Documents/sun/front-end/node_modules/rimraf/rimraf.js:334:7) at Function.rimrafSync [as sync] (/Users/nomad/Documents/sun/front-end/node_modules/rimraf/rimraf.js:304:9) at /Users/nomad/Documents/sun/front-end/node_modules/clean-webpack-plugin/index.js:166:16 at Array.forEach () at CleanWebpackPlugin.clean (/Users/nomad/Documents/sun/front-end/node_modules/clean-webpack-plugin/index.js:92:15) at CleanWebpackPlugin.apply (/Users/nomad/Documents/sun/front-end/node_modules/clean-webpack-plugin/index.js:212:20) at webpack (/Users/nomad/Documents/sun/front-end/node_modules/webpack/lib/webpack.js:37:12) at processOptions (/Users/nomad/Documents/sun/front-end/node_modules/webpack-cli/bin/cli.js:441:16) at yargs.parse (/Users/nomad/Documents/sun/front-end/node_modules/webpack-cli/bin/cli.js:528:3) at Object.parse (/Users/nomad/Documents/sun/front-end/node_modules/webpack-cli/node_modules/yargs/yargs.js:552:18) at /Users/nomad/Documents/sun/front-end/node_modules/webpack-cli/bin/cli.js:219:8 at Object. (/Users/nomad/Documents/sun/front-end/node_modules/webpack-cli/bin/cli.js:530:3) at Module._compile (module.js:624:30) at Object.Module._extensions..js (module.js:635:10) at Module.load (module.js:545:32) at tryModuleLoad (module.js:508:12) at Function.Module._load (module.js:500:3) at Module.require (module.js:568:17) at require (internal/module.js:11:18) at Object. (/Users/nomad/Documents/sun/front-end/node_modules/webpack/bin/webpack.js:157:2) at Module._compile (module.js:624:30) at Object.Module._extensions..js (module.js:635:10) at Module.load (module.js:545:32) at tryModuleLoad (module.js:508:12) at Function.Module._load (module.js:500:3) at Function.Module.runMain (module.js:665:10) at startup (bootstrap_node.js:187:16) at bootstrap_node.js:608:3 npm ERR! code ELIFECYCLE

chrisblossom commented 5 years ago

Closed in v2.0.0 via #99. See johnagan/clean-webpack-plugin#usage. Please open a new issue if you continue to have problems.