Isn't there a simple fix for the elevation required issue? #862
-
I know there's been lots of discussion around this before. Still, it looks to me like the root cause of current problems with NVM needing elevated permissions is the current definition of the NVM_SYMLINK environment variable pointing into the shared ProgramFiles folder and not into a per-user folder. I have modified that (and the corresponding PATH section), and I've been happy with the result for months. Here's a PowerShell script that does it (only for the current shell session): $nvmhome = $env:NVM_HOME # C:\Users\burt_\AppData\Roaming\nvm
$old = $env:NVM_SYMLINK # C:\Program Files\nodejs
$new = $nvmhome.Replace('nvm','nodejs')
$env:NVM_SYMLINK = $new # C:\Users\burt_\AppData\Roaming\nodejs
$env:Path = $env:Path.Replace($old, $new) # not required, just in case Is there a reason the current installer wouldn't work with this simple change? I don't understand the InnoSetup stuff, or I would submit a PR. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
The installer already provides the option to specify whatever directory you want. I usually just install to That said, your script seems like a good option for those who have "directory selection remorse" and want to make a change. For most users, not having |
Beta Was this translation helpful? Give feedback.
The installer already provides the option to specify whatever directory you want. I usually just install to
C:\nvm4w
.That said, your script seems like a good option for those who have "directory selection remorse" and want to make a change.
For most users, not having
NVM_SYMLINK
pointed to a protected directory would be enough. However; in some environments, symlinks themselves require elevated admin privileges, regardless of whether the directory is protected or not. This is prominent in older versions of Windows. Newer versions of Windows have "Developer Mode", which will help bypass elevation for symlinks on non-protected directories.