Try removing your root: '/public', key value and remove forward slash from ['js/']

if you really need a root key in your settings, make sure it is an absolute path:

root: __dirname or root: "E:/node_projects/my_project",

Plugin does work for me with these settings:

new CleanWebpackPlugin(['dist'], {
    //root: '/',
    verbose: true,
    dry: false,
    exclude: ['example.txt']
}),

My project setup:

enter image description here

Here is my console output:

enter image description here

Webpack Clean- /public/js has been removed - Stack Overflow

https://stackoverflow.com/questions/43261320/webpack-clean-public-js-has-been-removed

Plugin does work for me with these settings: new CleanWebpackPlugin(['dist'], { // root: '/', verbose: true, dry: false, exclude: ['example.txt'] }),.

dist folder not being removed · Issue #93 · johnagan/clean-webpack ...

https://github.com/johnagan/clean-webpack-plugin/issues/93

Sep 15, 2018 ... new CleanWebpackPlugin(pathsToClean),. The output shows that is worked logging this =>clean-webpack-plugin: {path}\dist has been removed.

clean-webpack-plugin - npm

https://www.npmjs.com/package/clean-webpack-plugin

Apr 10, 2021 ... clean-webpack-plugin. TypeScript icon, indicating that this package has built-in type declarations. 4.0.0-alpha.0 • Public • Published 3 months ...

npm start提示clean-webpack-plugin:...-慕课网

https://www.imooc.com/qadetail/268800

npm start提示clean-webpack-plugin: /home/www/imooc/es6-webpack/dist has been removed.

clean-webpack-plugin - npm Package Health Analysis | Snyk

https://snyk.io/advisor/npm-package/clean-webpack-plugin

Learn more about clean-webpack-plugin: package health score, popularity, security, maintenance, versions and more.

npm start后显示clean-webpack-plugin:...-慕课网

https://www.imooc.com/qadetail/265139

2018年7月4日 ... npm start后显示clean-webpack-plugin: F:\myProject\es6-webpack\dist has been removed.

How to build oss-web-ui? - Getting Started - Sensu Community

https://discourse.sensu.io/t/how-to-build-oss-web-ui/2083

Oct 9, 2020 ... ... http://localhost:8080 clean-webpack-plugin: /opt/sensu/web/build/app has been removed. listening on 5000 (node:170) DeprecationWarning: ...

npm run build 打包错误显示clean-webpack-plugin:E:WEBUI\dist ...

https://blog.csdn.net/hayayo/article/details/102484863

2019年10月10日 ... npm run build 打包错误显示clean-webpack-plugin:E:WEBUI\dist*has been removed通常项目会分成三个运行环境:开发人员在本地跑的开发 ...

Atom locks files and folders while running - support - Atom Discussion

https://discuss.atom.io/t/atom-locks-files-and-folders-while-running/49242

Nov 1, 2017 ... My webpack config removes a folder, then tries to add it back, but fails. clean- webpack-plugin: C:\project-name\dist has been removed.

rizar's gists · GitHub

https://gist.github.com/rizar

webpack --progress -d --config webpack.config.js. clean-webpack-plugin: /home/ dzmitry/Dist/arl-omnishop/static/dist has been removed. 10% building modules ...