Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Allow symlinks for npm link instead of junctions #8520

Closed
Yogu opened this issue Jun 10, 2015 · 2 comments
Closed

Allow symlinks for npm link instead of junctions #8520

Yogu opened this issue Jun 10, 2015 · 2 comments

Comments

@Yogu
Copy link

Yogu commented Jun 10, 2015

I'd like to have an option for npm link to create symbolic links instead of junctions (on Windows). Currently, the junction type is hardcoded.

The reason is simply that JetBrains decided to not support junctions - deleting a junction will delete the contents of its target in WebStorm. Of course, this is a bug on their side, but I think having an option would not harm npm.

I'm willing to create a pull request but I do not know yet how to pass the option the best way. Any suggestions? How do you think about this in general?

@othiym23
Copy link
Contributor

I see and understand your problem, but there are a few other problems to overcome here. The reason that npm uses junctions is that creating symbolic links on Windows requires Administrator privileges. Every install using this option would therefore require that npm be run from a shell with Administrator privileges. The code is relatively simple to change, but we'd have to add new documentation with clear warnings that the option would only work when running as Administrator. The fact that people frequently miss things in the (voluminous) documentation in turn adds to npm's support overhead.

Adding an option is not in itself harmful, except for the fact that npm already has a vast number of options that make mastering its use harder than it could be. As a result, I'm reluctant to add new options unless there's a compelling use case.

Also, this particular scenario is working around a limitation in another tool. Taken all together, I don't think this is something it makes sense for npm to change. Thanks for asking, and for providing a clear use case!

@Yogu
Copy link
Author

Yogu commented Jun 11, 2015

I completely understand your reasoning. Thanks for the consideration. We now manually create symlinks instead of using npm link, which has the additional advantage that there are no global links (they do not suit our use case well)

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

No branches or pull requests

2 participants