file operation permission - nodejs

In file operations with wrench by copyDirSyncRecursive (with opts: { preserve: false }), I get the Error: EPERM, operation not permitted error.

As I pointed out, is this a permission violation in filesystem? If it is, is there a way to authenticate me as admin / root to execute this operations?

4 comments:

  • Don't use synchronous operations. Node.js it's asynchronous by nature. If you want to write synchronous code use another scripting language like python. If you use a single synchronous function you're blocking the entire event loop and the rest of asynchronous functions will need to wait.
  • Don't use wrench.js. It's bugged and has a bad error management especially in the parallel asynchronous functions (readdirRecursive, rmdirRecursive, etc). I can't understand how a bugged code that can ruin you're entire application has 150+ stars.
  • Don't use wrench.js. It promotes a bad usage of node.js using synchronous functions.
  • If you want to execute forbidden operation start node.js with admin privileges (windows) or root permissions (linux).