-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix "EXDEV: cross-device link not permitted" error #1174
Conversation
Not sure why standard passes in my dev environment, but hopefully this fixes the CI errors.
@@ -7,10 +7,15 @@ export default async function replaceCurrentBuild (dir, buildDir) { | |||
const oldDir = join(buildDir, '.next.old') | |||
|
|||
try { | |||
await rename(_dir, oldDir) | |||
await move(_dir, oldDir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mv
package doesn't return a promise but rather expects a callback, in this case await will not wait for the move to complete.
https://github.com/andrewrk/node-mv/blob/master/index.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, mv
doesn't return a promise so that's why I created the move
wrapper function and used that. Await works as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right 👍 Was reviewing on my phone
Wow, my bad :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
This looks really nice. Thanks. |
Thanks for fixing! IMO, this justifies an I'm currently using a mac but just bumped into this, as my work and temp folders are on different volumes. |
It looks like this error was introduced in PR #1150. I'm currently developing on Windows from a
D:\
drive, while my temp directory is onC:\
. It turns out that Node cannot do cross-device renames so a module, calledmv
, was created for that very purpose. I swapped in this module in place ofrename
frommz/fs
and I'm now able to build.Here are some references I came across while debugging this:
facebookarchive/nuclide#94
http://stackoverflow.com/q/37153666
http://stackoverflow.com/q/12196163