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

Windows support? #89

Closed
DaleLJefferson opened this issue Feb 21, 2018 · 12 comments
Closed

Windows support? #89

DaleLJefferson opened this issue Feb 21, 2018 · 12 comments
Labels

Comments

@DaleLJefferson
Copy link

Does this plugin work on windows?

I get the following error when I attempt to use this plugin.

EPERM: operation not permitted, symlink 'C:\Users\Dale\Development\www.dalejefferson.com\node_modules' -> 'C:\Users\Dale\Development\www.dalejefferson.com\.build\node_modules'
@DaleLJefferson DaleLJefferson changed the title Windows support Windows support? Feb 21, 2018
@cspotcode
Copy link

I managed to get past that error, but excludeDevDependencies is not excluding transitive dependencies. So I think the answer is no, not at the moment.

@j-murph
Copy link

j-murph commented Apr 12, 2018

Running as administrator fixed it for me.

@dls314
Copy link

dls314 commented Jun 4, 2018

Is there any update on this, or related issues (like #23, #45, #90) around using serverless-plugin-typescript on windows?

For whatever reason, the workaround that previously worked (being an administrator) isn't working for me on Windows 10 build 17134.

@GhostfromTexas
Copy link

GhostfromTexas commented Jun 4, 2018

We've fixed this issue and created a PR for it, however this project hasn't been updated really since February.

#103

There are 2 current issues people get with the symbolic link problem. The permissions problem and a EPERM scandir problem because the link to node_modules is invalid in the .build directory.

We created an NPM module with our fix in it for those that want to use it

https://www.npmjs.com/package/@hewmen/serverless-plugin-typescript

@didac-wh
Copy link

didac-wh commented Jun 14, 2018

@GhostfromTexas I appreciate your effort. Unfortunately it doesn't seem to work for me, as I'm getting the exact same error as before:

EPERM: operation not permitted, symlink '[source_dir]\package.json' -> '[source_dir].build\package.json'

I basically installed your NPM package and imported it in my severless.yml plugins section, removing the old serverless-plugin-typescript.

Don't know if I'm doing something wrong...

@GhostfromTexas
Copy link

Hmm - Try an elevated console and see if that works. We might have only solved part of that problem

@dls314
Copy link

dls314 commented Jun 16, 2018

Mixed experiences for me, hewmen/serverless-plugin-typescript has no errors for me when packaging from windows, but the packaging also doesn't correctly exclude dev dependencies (either on windows or linux)

@GhostfromTexas
Copy link

GhostfromTexas commented Jun 18, 2018

I wonder if the dev-dependency exclusion is on the original version as well. The only problem we pushed a change for was the symbolic linking. Excluding dev dependencies might be an unrelated bug, or maybe a bug we caused?

@dls314
Copy link

dls314 commented Jun 19, 2018

I don't think the changes made anything worse, but I only hit the EPERM scandir problem when I was trying to exclude dev dependencies, so it's all somewhat related.

fwiw/ the underlying calls to npm ls --dev=true --parseable=true --long=false --silent and npm ls --prod=true --parseable=true --long=false --silent being used by zipService.js don't seem to work the same through a symlink on Windows (even with the fix introduced in #103)

https://github.com/serverless/serverless/blob/master/lib/plugins/package/lib/zipService.js#L166

It doesn't seem to work the same; when I interrupt serverless package on windows and then run the npm ls command from the root or .build directory, I get different results depending on being in the .build or root directory.

@GhostfromTexas
Copy link

Hmm.. We exclude dev dependencies on ours as well and don't see the EPERM scandir problem anymore with the HEWMEN version. So looks like there are some more edge cases that are causing the same problems to pop up.

What we saw originally was the build failing at the packaging step, and from the looks of the .build folder structure, the symlink to the "node_modules" directory was created as a file and not a folder.

So looking like there are 3-4 issues then... weee!

@dls314
Copy link

dls314 commented Jun 20, 2018

Packaging on Windows is producing much smaller packages when I set the NODE_PRESERVE_SYMLINKS=1 environment variable. I'm not yet certain that's fixed dev dependency exclusion, but it seems to have so far.

JackCuthbert added a commit that referenced this issue Apr 6, 2019
Closes #130, #23, #89, #100, #103. New PR to be opened for resolution of
further issues with Windows symlink failures.
JackCuthbert added a commit that referenced this issue Apr 6, 2019
Closes #130, #23, #89, #100, #103. New PR to be opened for resolution of
further issues with Windows symlink failures.
JackCuthbert added a commit that referenced this issue Apr 6, 2019
@divyenduz
Copy link
Contributor

🎉 This issue has been resolved 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

No branches or pull requests

7 participants