Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

file operation permission - nodejs

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?

Problem courtesy of: mrzmyr



  • 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).
Solution courtesy of: Gabriel Llamas


View additional discussion.

This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

file operation permission - nodejs


Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription