-
Notifications
You must be signed in to change notification settings - Fork 230
Fix Windows symlink EPERM error #140
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
LGTM, if someone involved in this issue can also confirm that this fixes related issues for them, I am happy to merge this. |
@divyenduz I can confirm that @EugeneDraitsev fixed the symlink issue for me. I combined @GhostfromTexas third parameter fix into my personal fork for good measure. As stated before, while this resolved symlink issues, on my other machine and my colleague's machine, we were still running into a scandir issue after utilizing this fix, which is a separate issue and was resolved by installing the scandir library globally with Note that I am in a Windows 10 environment and that was the only environment tested in my case. |
@JackCuthbert : Do you want to address the issue about |
@divyenduz I couldn't repro the scandir issue in my Win10 VM that @maplion was encountering :( Installing it globally made no difference both before and after this fix was applied. I did encounter the EPERM issue before applying the fix though, so I feel that this definitely solves this part of the problem. Perhaps we can get some more info about why scandir is erroring? Is it definitely related to using this plugin under Windows? |
@JackCuthbert Yes, it is definitely related to using the plugin under Windows, but there is some additional variable on our enterprise machines that makes it not work when my home computer worked after the symlink fix alone. I tested anti-virus, permissions (running as admin), and other possible culprits and nothing worked until a colleague found a Reddit post talking about scandir in an unrelated topic with a similar error and needing to install it globally. The only thing I can think of that might be different still is something to do with the Windows profile. |
@divyenduz I'm happy to merge this one as it solves the symlink issue and we can close out a bunch of other issues/PRs. By the sound of it the |
@JackCuthbert When I get a moment, sure. |
🎉 This PR is included in version 1.1.7 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Based on work by @josenicomaia in #24, @EugeneDraitsev in #100, and discussion in #103 this should resolve the EPERM issue when packaging on Windows.
I've tested this by spinning up a Windows 10 Pro VM and running
serverless package
with the code inexample/
(adding/removing includes as well). It runs successfully while correctly copying thenode_modules
folder andpackage.json
files. Mac and Linux should still work as normal with symlinked directories, tested on Arch Linux.Also includes an update to the build script to use
rimraf
asrm -rf
is not available on Windows, this should help Windows devs contribute future fixes/features.It would be great to get someone else to pull this down and give it a go 😄