1

How do I move/delete/rename a busy Directory with node.js?

Currently I'm using fs-extra package to move and replace a directory.

fse.move(src, dest, { overwrite: true }, err => {
    if (err) return console.error(err)
    console.log('moved')
 })

src and dest have the same folder name of course, But dest folder is busy and I need to overwrite even if it busy or blocked. enter image description here

Faid
  • 554
  • 1
  • 5
  • 18
  • _“`src` and `dest` have the same folder name of course”_ — Why “of course”? What are you trying to do? What are you trying to replace the directory with? – Sebastian Simon Sep 23 '20 at 01:35
  • @user4642212 I need to update `dest` files which contains `node_modules` and other files. The problem is that I have no other ways to update except this, That's because I run update code after `dest` is in use (software open). – Faid Sep 23 '20 at 01:43

0 Answers0