Is node.js rmdir recursive ? Will it work on non empty directories?

后端 未结 22 1363
清歌不尽
清歌不尽 2021-01-31 13:41

The documentation for fs.rmdir is very short and doesn\'t explain the behavior of rmdir when the directory is not empty.

Q: What happens if I try to use

22条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-31 14:01

    This worked for me

    fs.rmdirSync(folderpath, {recursive: true});
    

提交回复
热议问题