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] EPERM: operation not permitted, symlink #34

Closed
kingyue737 opened this issue Nov 10, 2022 · 4 comments
Closed

[Windows] EPERM: operation not permitted, symlink #34

kingyue737 opened this issue Nov 10, 2022 · 4 comments

Comments

@kingyue737
Copy link

OS: Windows 11

In dev mode, it works perfectly, but when I try to build, the following error exists:

Error: EPERM: operation not permitted, symlink 'D:\Solutions\my-repo\node_modules\.pnpm\shiki@0.11.1\node_modules\shiki' -> 'D:\Solutions\my-repo\dist\shiki'

Any help would be appreciated!

@kingyue737
Copy link
Author

Running an elevated terminal can solve this issue.

@sapphi-red
Copy link
Owner

I guess it's failing because Windows requires administrator permission to create a symlink by default.
Maybe it will work if dereference: true was passed here.

await fs.copy(resolvedSrc, resolvedDest, { preserveTimestamps })

@kingyue737
Copy link
Author

kingyue737 commented Nov 11, 2022

Directly copying file to dist rather than symlink make the dist folder portable (I can easily send all built files in dist folder to my teammates). Maybe add an option to allow user to determine whether copy or symlink?

@sapphi-red
Copy link
Owner

That makes sense. I made dereference: true by default. (And a option to turn that off)
dde68b7

I've released v0.12.0 that includes that change.

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

No branches or pull requests

2 participants