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 EPERM on windows (#83) #165

Closed
wants to merge 1 commit into from
Closed

Fix EPERM on windows (#83) #165

wants to merge 1 commit into from

Conversation

ArtskydJ
Copy link

Like #161, but it only skips writing to the dotfile if it's on windows.

On windows, it will pipe directly to the outfile.
On other platforms, it will pipe to the dotfile and rename it to the outfile.

Fixes #83.

@zertosh
Copy link
Member

zertosh commented Mar 23, 2015

@ArtskydJ Do you know if I can reproduce the issue using a VM from modern-ie? What version of windows should I try out?

@ArtskydJ
Copy link
Author

@zertosh I don't know anything about VM's from modern-ie. But I have successfully reproduced the issue on Windows 7 and Windows 8 using the following steps:

  1. Do watchify -v -d index.js -o bundle.js.
  2. Save index.js with a syntax error.
  3. Fix the syntax error and save index.js twice.

Edit: Found these steps here: #83 (comment)

@zertosh
Copy link
Member

zertosh commented Mar 23, 2015

@ArtskydJ What editor was doing the saving? Does it happen with Sublime?

@ArtskydJ
Copy link
Author

@zertosh I believe I have reproduced this error using Sublime Text 3, Notepad++ and Atom.

@zertosh
Copy link
Member

zertosh commented Mar 23, 2015

@ArtskydJ Perfect. Give me a day or two to see if I can reproduce it using a VM, and if so, I'll take this patch out spin. Thanks for looking into this!

@ArtskydJ
Copy link
Author

@zertosh You're welcome. Thanks for helping!

@zertosh
Copy link
Member

zertosh commented Mar 25, 2015

@ArtskydJ I was able to repro on a "IE10 on Win7 for VirtualBox for Mac" from modern.IE VM. I had to install git, node and Sublime Text 3.

nklvk

I'm a bit swamped right now, I'm going to need another day or two to fully test this out. I'm thinking that the solution is actually to use graceful-fs, from the README: "On Windows, it retries renaming a file for up to one second if EACCESS or EPERM error occurs, likely because antivirus software has locked the directory."

@ArtskydJ
Copy link
Author

Interesting. I actually implemented a retry, but it did not solve the problem. (It would retry every second for up to 10 seconds.) I have reproduced the issue with, and without anti-virus software running.

This patch solved the problem for me on both computers I work with, so I don't know why it's not working for you.

Did you clone my fork, check out the fix-eperm4 branch, and run npm link?

C:\Users\Michael\Github\javascript\watchify\example>watchify files/main.js -v -o bundle.js
1228 bytes written to bundle.js (0.06 seconds)
Error: Parsing file C:\Users\Michael\Github\javascript\watchify\example\files\main.js: Unexpected token (2:17)
1228 bytes written to bundle.js (0.02 seconds)
1228 bytes written to bundle.js (0.03 seconds)

You don't have to run npm link if you don't want to.

C:\Users\Michael\Github\javascript\watchify>node bin\cmd.js example\files\main.js -v -o example\bundle.js
1228 bytes written to example\bundle.js (0.06 seconds)
Error: Parsing file C:\Users\Michael\Github\javascript\watchify\example\files\main.js: Unexpected token (1:0)
1228 bytes written to example\bundle.js (0.01 seconds)
1228 bytes written to example\bundle.js (0.02 seconds)

@zertosh
Copy link
Member

zertosh commented Mar 25, 2015

@ArtskydJ Sorry for the misunderstanding. I was able to repro the bug, I haven't tried your patch yet. I just came across that line in graceful-fs while I was waiting for the VM image to download heh

@ArtskydJ
Copy link
Author

@zertosh Ha ha, sorry, I misunderstood you. :P

@zertosh zertosh mentioned this pull request Mar 25, 2015
7 tasks
@zertosh
Copy link
Member

zertosh commented Mar 26, 2015

@ArtskydJ I think I found the problem and #169 is the fix. Can you please give it a test drive?

@ArtskydJ
Copy link
Author

Closing in favor of #169.

@ArtskydJ ArtskydJ closed this Mar 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: EPERM, rename '...something...'
2 participants