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

Local node_modules - Use junctions instead of symlinks on Windows #16006

Closed
dsherret opened this issue Sep 22, 2022 · 3 comments · Fixed by #16061
Closed

Local node_modules - Use junctions instead of symlinks on Windows #16006

dsherret opened this issue Sep 22, 2022 · 3 comments · Fixed by #16061

Comments

@dsherret
Copy link
Member

dsherret commented Sep 22, 2022

Edit: Use junctions instead like pnpm does (see comments below)

Users on Windows need to enable developer mode to get the local node_modules working because it uses symlinks.

https://learn.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development

I think though that some users might not be able to enable this, but I'm not sure how widespread of an issue this is.. so for now, let's add some instructions about enabling developer mode then maybe in the future have a warning then fallback solution for those users.


See error from: #15427 (comment)

PS C:\Users\rekke\Documents\vite-deno-example> deno task dev
Warning deno task is unstable and may drastically change in the future
Task dev deno run -A --unstable --node-modules-dir npm:vite
error: A required privilege is not held by the client. (os error 1314), symlink 'C:\Users\rekke\Documents\vite-deno-example\node_modules\.deno\esbuild-freebsd-arm64@0.15.8\node_modules\esbuild-freebsd-arm64' -> 'C:\Users\rekke\Documents\vite-deno-example\node_modules\.deno\esbuild@0.15.8\node_modules\esbuild-freebsd-arm64'
@DefinitelyMaybe
Copy link

brilliant! thank you @dsherret

@brc-dd
Copy link

brc-dd commented Sep 23, 2022

You can just use junction mode to create symlinks in Windows. Junctions don't need elevation or developer mode to be enabled. That's what pnpm do.

@dsherret
Copy link
Member Author

Huh, good to know. Thanks @brc-dd! I found this crate for doing that https://docs.rs/junction/latest/junction/

@dsherret dsherret changed the title Local node_modules - Add instructions for Windows users that can't create symlinks Local node_modules - Use junctions instead of symlinks on Windows Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants