Monday 24 August 2020

EACCES: permission denied with fs-extra only using nodemon

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


from EACCES: permission denied with fs-extra only using nodemon

No comments:

Post a Comment