Skip to content
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

Merged
merged 3 commits into from
Feb 16, 2017

Conversation

dizlexik
Copy link
Contributor

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 on C:\. It turns out that Node cannot do cross-device renames so a module, called mv, was created for that very purpose. I swapped in this module in place of rename from mz/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

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)
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

@timneutkens timneutkens Feb 16, 2017

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 :/
Copy link
Member

@timneutkens timneutkens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@timneutkens timneutkens merged commit 2e0db62 into vercel:master Feb 16, 2017
@arunoda
Copy link
Contributor

arunoda commented Feb 16, 2017

This looks really nice. Thanks.

@icflorescu
Copy link

Thanks for fixing!

IMO, this justifies an npm push asap, especially since the error is not only occurring on windows.

I'm currently using a mac but just bumped into this, as my work and temp folders are on different volumes.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants