-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Elevation broke between 1.1.7 and 1.1.9 #767
Comments
Probably not what you want though, as this will potentially prevent the unprivileged user account from managing it in the future. |
Well... yeah... that is why I opened it as administrator... to get around the fact that the unprivileged user account couldn't do it.. |
I've run into this also, I was upgrading from NVM 1.1.6 to 1.1.9 (upgraded to try and fix some bugs I was running into) and I ran into the same problem as @WORMSS when trying to switch node versions in powershell where the UAC prompt no longer popped up for NVM and gave me the I'm trying to avoid opening up a separate elevated powershell just to switch my node version, but right now it seems like the only way without downgrading. Sadly I can't run everything from an elevated powershell due to user ssh key differences, and user file ownership issues with my everyday work user account and the separate admin account I have (which should only be used for elevation as needed). My company's IT department gets - understandably -nervous if I run everything on the local admin account, they prefer I use it sparingly. |
Just use 1.1.7 for now, as I've pointed out here: #700 (comment) |
@diogoeichert That's a good suggestion for those who want to go that route, but there are a number of benefits of using post 1.1.7 releases according to the release notes. A signed installer is a big one for some orgs. I'm sure Corey is busy with his As an additional workaround, there are tools that enable "sudo" like functionality that present UAC prompts. I just tested successfully with gsudo for example:
Each time I ran gsudo it presented me with a UAC prompt. The tool is sophisticated enough to not reprompt either, but that has its own security risks/concerns. Personally if I were to continue using it I'd try to stick with constant prompting. There are other similar tools besides gsudo worth considering, though gsudo seems like it's at least more recently maintained. Depending on your situation this may be a decent workaround as well. |
@ojintoad Nice, I wasn't aware such tools existed for Windows already. Thanks for sharing. |
I need to go to bed but figure I would speak to how far I got in trying to understand this. I'm not quite sure I want to open a PR. This is the first time I've touched Go as a language and the first time I've touched this library so any assumptions I'm making come with a big caveat. First, I am slightly confused about what the Lines 891 to 897 in 5803c4f
I think the intent might have been to have 893 have a Lines 866 to 877 in 5803c4f
That hits a new problem when trying to do But even if you remove that, it appears to fail to call correctly in a different way since the elevate.cmd really doesn't appear to like having parameters passed in as a straight string. So you get an error like this: Edit - additionally if you just pass the
That somewhat surprises me as I think the other commands do get passed that way, so there's something specific about that command or I'm missing something about how it works. Regardless of why it's failing, we want to still try to call that command to make the symlink in a way we know that works. We know that 1.1.7 works. If we look at the 1.1.7 version, you can see it calls Line 444 in 256d694
Since I don't quite know the intent of the Line 562 in 5803c4f
This seemed to generate the UAC prompt and update the symlink appropriately. I don't think this perfectly captures every error case - if the "file already exists" for example it may not behave quite right or something. I didn't actually ever see that happen in my testing though. I did notice that as a result I could set an "admin" version and a standard user version distinctly. That is, from an admin prompt, I don't really know if this is a good solution or not. I'm gonna stop here but am curious if anyone has any feedback for me. If not, at least I learned some Go. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
ping |
So, the problem between 1.1.7 and later versions is still happening. |
For anyone upgrading past I didn't do thorough testing, but if you take
|
Same issue, Win 11, Dev mode enabled, |
I found this helpful: https://github.com/coreybutler/nvm-windows/wiki/Common-Issues#permissions-exit-1-exit-5-access-denied-exit-145 I got rid of this error on my machine by:
This worked for me on a fresh install of Windows 11 21H2 (22000.675). |
This issue has been reported almost 4 months ago and remains unresolved. Even better, the current release is even older, so the issue has technically existed for well over half a year. How hard would it be, dear developer, to compare between 1.1.8 and 1.1.7 what has likely caused UAC prompting to stop working? I say revert whatever change caused this bug and be done with it. I'm not an impatient guy, but half a year is a teeny tiny tad on the long side, for an issue that was provably introduced from one minor version into the next. Do you agree? |
Happen have this issue, so I'm using this approach to nvm use. It'll prompt UAC. especially if use powershell. "start powershell -v runas -Wait -ArgumentList {/c nvm use 10.24.1} -WindowStyle Hidden" |
Indirectly related to this - there is a group policy that you can enable for just the permission to create symlinks. I get that developer mode resolves this, but it seems wild to want to enable that over a specific group policy that enables the single permission in particular. That resolved this for me. |
Same happening here |
same, things were fine with 1.1.7, now on 1.1.9 i keep retrying but doesn't work |
A bug like this makes this project feel abandoned. Setting up tricks to work around the UAC prompt is insane. A program that requires elevation, should ask for it. Users should not have to muddle around this for months. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Bump. Not stale |
I've managed to make quite a nice work around since he has publicly stated he isn't going to fix the issue himself. My Idea: |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
bump, not fixed yet |
I believe this is taken care of in v1.1.10. Testing was minimal, but yielded the desired results. If you're still struggling with this, @WORMSS provided a workaround that seems to do the job. |
Issue:
1.1.9 no longer pops up UAC to asks to to change node/npm, it just FAILS straight away with
exit status 5: Access is denied
How To Reproduce:
nvm-setup.zip
ornvm-update.zip
Expected Behavior:
To do step 3 and step 4 in 1.1.9, just like 1.1.7 used too.
Just to note, this does the EXACT same thing in CMD also..
Work around, I open a CMD window as administrator, and it works. But this is a major ballache to do.
Windows: 10.0.19044.1526
The text was updated successfully, but these errors were encountered: