Open lloydjatkinson opened 1 year ago
@stephengillie - Area-Path also
Duplicate of #3067
@lloydjatkinson we've identified this Issue as a duplicate of another one that already exists. This specific instance is being closed in favor of tracking the concern over on the referenced Issue. Thanks for your report! Be sure to add your π to the other issue to help raise the priority.
Duplicate of #222
@lloydjatkinson we've identified this Issue as a duplicate of another one that already exists. This specific instance is being closed in favor of tracking the concern over on the referenced Issue. Thanks for your report! Be sure to add your π to the other issue to help raise the priority.
I had the same problem.
This solution seems to work for me.
winget install --id=CoreyButler.NVMforWindows -e --silent
$env:NVM_HOME = [System.Environment]::GetEnvironmentVariable("NVM_HOME", "User")
$env:NVM_SYMLINK = [System.Environment]::GetEnvironmentVariable("NVM_SYMLINK", "User")
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
nvm install 18.6.0
nvm use 18.6.0
@lloydjatkinson this issue has been marked as duplicate and has not had any activity for 1 day. It will be closed for housekeeping purposes.
@lloydjatkinson this issue has been marked as duplicate and has not had any activity for 1 day. It will be closed for housekeeping purposes.
@denelon
Totally agree that PATH should be reloaded after installing package so i can use it right away, similar feature request for chocolatey https://github.com/chocolatey/choco/issues/2458
We're currently working on the dependency flow:
https://github.com/microsoft/winget-cli/issues/2939
You may also want to take a look at:
We're looking at a few scenarios related to the path, and there is discussion and a possible workaround as well as some design work on how we might achieve this.
@lloydjatkinson, after installing the WingetPathUpdater
package, this should work as expected. It requires admin to install, though.
C:\Windows\System32>where nvm
INFO: Could not find files for the given pattern(s).
C:\Windows\System32>set nvm
Environment variable nvm not defined
C:\Windows\System32>winget install WingetPathUpdater
Found WingetPathUpdater [jazzdelightsme.WingetPathUpdater] Version 1.2
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://github.com/jazzdelightsme/PowershellStub/releases/download/v1.0/PowershellStub.exe
ββββββββββββββββββββββββββββββ 1.87 KB / 1.87 KB
Successfully verified installer hash
Starting package install...
Successfully installed
C:\Windows\System32>winget install --id=CoreyButler.NVMforWindows -e
Found NVM for Windows [CoreyButler.NVMforWindows] Version 1.1.11
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://github.com/coreybutler/nvm-windows/releases/download/1.1.11/nvm-setup.exe
ββββββββββββββββββββββββββββββ 5.46 MB / 5.46 MB
Successfully verified installer hash
Starting package install...
Successfully installed
C:\Windows\System32>where nvm
C:\Users\AdminUser\AppData\Roaming\nvm\nvm.exe
C:\Windows\System32>set nvm
NVM_HOME=C:\Users\AdminUser\AppData\Roaming\nvm
NVM_SYMLINK=C:\Program Files\nodejs
C:\Windows\System32>
Description of the new feature / enhancement
Some software that is installed adds itself to the
PATH
environment variable. These changes are not surfaced to the current terminal session and requires the user to close the terminal and open it again. I consider this to be a huge blocker for creating fully automated software installations as the environment variables it added are often needed in the next step.Consider NVM as per the docs here: https://learn.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-windows
Followed by another line in the same script (again, as per the docs):
Results in:
Proposed technical implementation details
WinGet or Terminal should update the user environment variables in order to unblock automated installations of software