-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[BUG] npm install in a workspaces environment requires admin permissions on Windows #1923
Comments
Hi, pr that fix it |
Lovely - thank you. Certainly looks like it'll fix it. (Not sure how that resulting failing build's going to be fixed though. Dealing with a mandated 100% branch coverage for something that needs platform-specific logic is going to be a little 'tricky'...) |
For the record, I can confirm this also occurs . Node 15.0.1, npm 7.0.3 (latest current) but not Node 14.15.0 , npm 6.14.8 (latest LTS) when simply doing a regular install with As discussed in pre-commit/pre-commit#1681 , this makes Node 15/npm 7 unusable for running this popular hook on Windows, unless all developers either work in an admin console, or manually enable symlink support (neither of which isn't really feasible given we get a large number of contributors who are students, scientists, engineers or beginning programmers, and the goal with pre-commit is to greatly reduce the barrier to entry, not increase it). Therefore, fixing this would be greatly appreciated! I'm a Python developer, not a Node whiz, but I can try to help test if needed. Thanks! |
What about with npm v7.0.7? |
@ljharb It's still a problem with v7.0.7. The fix (npm/arborist#162) hasn't been merged in yet. |
Current Behavior:
npm install
in a workspaces environment fails if the current user is not running under administrator privileges because directory symlinks can't be created on Windows without admin privilege (or some rather non-standard configuration)Expected Behavior:
npm install
would ideally 'just work' on Windows, which could be done by using Windows 'junctions' instead of directory symlinks. These are pretty much the same as directory symlinks but don't require admin permissions.(This is what
yarn
does, incidentally. I'd love to be able to move back from yarn to npm, and workspace support is the killer feature for us.)With the current behaviour, npm 7 workspace support will be broken on Windows unless the user runs as admin or does some non-trivial configuration to enable the creation of directory symlinks. (No, I don't know why Windows requires this hoop-jumping just to make symlinks, but it does. It's grim. But junctions are an easy workaround for it.)
Steps To Reproduce:
npm install
See error:
Having to run as administrator isn't a realistic workaround for this sort of scenario; it would cause a lot of extra effort modifying build machines and scripts to be able to switch to administrator mode, and would massively weaken security as a result.
Environment:
OS: Windows 10
Node: 12.18.3
npm: 7.0.0-rc.3
The text was updated successfully, but these errors were encountered: