What does this error actually mean? What is a "cross-device link"?
It is mentioned on this libuv page but it doesn't give any details beyond "cross-device link not permitted".
What does this error actually mean? What is a "cross-device link"?
It is mentioned on this libuv page but it doesn't give any details beyond "cross-device link not permitted".
It is used for EXDEV on Linux:
See
man rename
manpage:This error is also used when there is
ERROR_NOT_SAME_DEVICE
on Windows, see:For more info see:
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:(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.