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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Windows symlink EPERM error #140

Merged
merged 3 commits into from Apr 8, 2019
Merged

Fix Windows symlink EPERM error #140

merged 3 commits into from Apr 8, 2019

Conversation

JackCuthbert
Copy link
Contributor

@JackCuthbert JackCuthbert commented Apr 6, 2019

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 in example/ (adding/removing includes as well). It runs successfully while correctly copying the node_modules folder and package.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 as rm -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 馃槃

@divyenduz
Copy link
Contributor

LGTM, if someone involved in this issue can also confirm that this fixes related issues for them, I am happy to merge this.

@maplion
Copy link

maplion commented Apr 7, 2019

@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 npm install scandir -g -- so the error was very misleading and shouldn't be confused with the symlink issue.

Note that I am in a Windows 10 environment and that was the only environment tested in my case.

@divyenduz
Copy link
Contributor

@JackCuthbert : Do you want to address the issue about scandir in @maplion's comment before I merge this or after? I am fine with both as this PR already provides some value :)

@JackCuthbert
Copy link
Contributor Author

JackCuthbert commented Apr 7, 2019

@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?

@maplion
Copy link

maplion commented Apr 7, 2019

@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.

@JackCuthbert
Copy link
Contributor Author

@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 scandir issue may not isolated to this plugin only if a similar error is happening in an unrelated context. Could you open a more specific issue for this @maplion?

@maplion
Copy link

maplion commented Apr 7, 2019

@JackCuthbert When I get a moment, sure.

@divyenduz divyenduz merged commit d6496ab into master Apr 8, 2019
@divyenduz
Copy link
Contributor

馃帀 This PR is included in version 1.1.7 馃帀

The release is available on:

Your semantic-release bot 馃摝馃殌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants