Skip to content

Suggestion: Do not elevate unless necessary #510

@rbuckton

Description

@rbuckton

There are cases where UAC elevation isn't necessary. For example, elevation is not required to create directory symlinks in Windows 10 build 14972 when Developer Mode is enabled, and elevation is not required if the current user owns the %NVM_SYMLINK% directory.

My Environment

  • Windows 7 or below (not truly supported due to EOL - see wiki for details)

  • Windows 8

  • Windows 8.1

  • Windows 10

  • Windows 10 IoT Core

  • Windows Server 2012

  • Windows Server 2012 R2

  • Windows Server 2016

  • My Windows installation is non-English.

I'm using NVM4W version:

1.1.7

I have already...

  • read the README to be aware of npm gotchas & antivirus issues.
  • reviewed the wiki to make sure my issue hasn't already been resolved.
  • verified I'm using an account with administrative privileges.
  • searched the issues (open and closed) to make sure this isn't a duplicate.
  • made sure this isn't a question about how to use NVM for Windows, since gitter is used for questions and comments.

My issue is related to (check only those which apply):

  • settings.txt
  • proxy support (Have you tried version 1.1.0+?)
  • 32 or 64 bit support (Have you tried version 1.1.3+?)
  • Character escaping (Have you tried version 1.1.6+?)
  • A standard shell environment (terminal/powershell)
  • A non-standard shell environment (Cmder, Hyper, Cygwin, git)

Expected Behavior

nvm use <version> should not require elevation when it is not necessary.

Actual Behavior

nvm use <version> prompts for UAC elevation even when in Windows 10 with Developer Mode and the user owns the %NVM_SYMLINK% directory.

Steps to reproduce the problem:

  1. Prereq: Windows 10 build 14972 or later
  2. Prereq: Windows 10 Developer Mode is enabled (under Start > Settings > Update & Security > For developers)
  3. Prereq: Running as a local administrator with UAC prompts enabled.
  4. Set the %NVM_SYMLINK% environment variable to a path that you control:
    SET NVM_SYMLINK=%APPDATA%\nodejs
  5. Run nvm use <version>
  • Notice that a UAC prompt is displayed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions