EACCES: permission denied with fs-extra only using nodemon

Viewed 967

I am attempting to use the move method from the fs-extra npm module. It works for moving files and empty directories, but every time I try to move a non-empty directory while using nodemon, I get this error:

[Error: EACCES: permission denied, rename 'path/to/src/dir' -> 'path/to/dest/dir'] {
  errno: -13,
  code: 'EACCES',
  syscall: 'rename',
  path: 'path/to/src/dir',
  dest: 'path/to/dest/dir'
}

However, if I try to use the exact same method with good ol' fashioned node index.js, it works with flying colors. Why does nodemon not have sufficient permissions and how do I fix it?

I have tried:

  • Installing nodemon with sudo
  • Installing nodemon without sudo
  • Each of the first two but running nodemon with sudo
  • Each of the first two but running nodemon without sudo

EDIT:

Because of @Aw Snap's comment, I tried it on Mac OS and it seems to work even with nodemon.

I wonder if this is a problem specifically with the Windows Subsystem for Linux...

0 Answers
Related