What does the “EXDEV: cross-device link not permitted” error mean?

It sounds like you’re trying to rename a file across “device” (partition) boundaries.

Say that /tmp is a different partition than /. That means that you’re not allowed to do this:

fs.rename('/tmp/myfile.txt', '/myfile.txt', ...)

(the same applies to fs.renameSync() as well, obviously)

If you want to do that, you need to first copy the file to its new location, and subsequently remove the old file. There are modules, like mv, that can help you with that.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)