-
Notifications
You must be signed in to change notification settings - Fork 49
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] Running shims from shims directory results in freezing with no output #129
Comments
On Windows, when executing a command, the system searches for executable files in the following order:
This means if there is an executable with the same name in the current directory, it will be used first. As for node's shim, it will splice a system environment variable and assign it to the newly created child process to execute the user's command. However, since the node.exe in the current folder has a higher priority, the system still uses the node.exe file in the current file when the child process is executed. Therefore, it will fall into an infinite loop. pub(super) fn command(exe: &OsStr, args: &[OsString]) -> Result<ExitStatus> {
let path = ENV_PATH
.clone()
.ok_or_else(|| anyhow!("command not found: {:?}", exe))?;
let status = CommandTool::create_command(exe)
.env("PATH", path)
.args(args)
.status()?;
Ok(status)
} I think this is in line with how the node.exe shim works. But for this question, I think users should be able to realize why this happens. Users can control it themselves to avoid executing the command directly in the |
@1111mp yes, that seems to be the cause. What about running the exe with full path, like |
After testing, using the complete %UserProfile%\.nvmd\versions\22.2.0\node.exe --version |
Yes, however the point actually was: What about running the |
Describe the bug
Running node/npm/npx/corepack shims from shims directory results in freezing with no output and can only be interrupted with Ctrl+C.
When running from any other directory they work as expected.
To Reproduce
Steps to reproduce the behavior:
NVM.Desktop_4.0.1_x64-setup.exe
on Windows 11 x64%UserProfile%\.nvmd\bin
is in PATH%UserProfile%\.nvmd\versions\22.9.0
nvm-desktop: command not found: "node"
after installing first Node version from GUI without runningnvmd use {version}
#128)$ "%UserProfile%\.nvmd\bin\node.exe" --version
Expected behavior
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: