Skip to content
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] nvm-desktop: command not found: "node" after installing first Node version from GUI without running nvmd use {version} #128

Closed
iki opened this issue Oct 16, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@iki
Copy link

iki commented Oct 16, 2024

Describe the bug

After fresh install of NVM Desktop and install of first Node version from GUI, default version is not set in %UserProfile%\.nvmd\default (file does not exist) and all node/npm/npx/corepack shims exit with nvm-desktop: command not found: "node" (replace node with npm/npx/corepack)

To Reproduce

Steps to reproduce the behavior:

  1. Install NVM.Desktop_4.0.1_x64-setup.exe on Windows 11 x64
  2. Install Node v22.9.0 via NVM Desktop
  3. [OK] Optionally check %UserProfile%\.nvmd\bin is in PATH
  4. [OK] Optionally check Node v22.9.0 is installed in %UserProfile%\.nvmd\versions\22.9.0
  5. [BUG] Check %UserProfile%\.nvmd\default -> Missing
  6. [BUG] Try running node/npm/npx/corepack via nvmd shim. Here I use explicit path to be sure:
$ "%UserProfile%\.nvmd\bin\node.exe" --version
nvm-desktop: command not found: "node"
# Same for npm/npx/corepack
  1. [Workaround] Run nvmd use explicitly
$ nvmd use v22.9.0
Now using node v22.9.0
  1. [OK] Repeat step 6 to verify shims work OK now.

Expected behavior

  • NVM Desktop GUI install of first Node version should set it as default
  • Error nvm-desktop: command not found: "node" should be more explicit: include where nmvd searched for it
  • If default is missing, it should report it, e.g. nvm-desktop: default node version is not set, use 'nvmd use {version}

Desktop (please complete the following information):

  • OS: Windows 11 23H2 Home 10.0.22635.4367
  • Arch: x64
  • NVM Desktop Version: 4.0.1
@1111mp
Copy link
Owner

1111mp commented Oct 16, 2024

First of all, thank you for your feedback. 🌹

Currently, after downloading a version, you need to manually set it as the default version through the Apply button:
image

NVM Desktop GUI install of first Node version should set it as default

I think doing so will make some users feel unacceptable (a feeling of being forced to take over). Perhaps there is another way to solve this problem: add a checkbox in the download pop-up box to "set it as the default version". If checked, it will be set as the default version after downloading, otherwise it will do nothing. Or maybe you have a better idea.

  • Error nvm-desktop: command not found: "node" should be more explicit: include where nmvd searched for it
  • If default is missing, it should report it, e.g. nvm-desktop: default node version is not set, use 'nvmd use {version}

Yes, a clearer and more complete error message should be given. I will improve this part in the next minor version.

1111mp added a commit that referenced this issue Oct 17, 2024
1111mp added a commit to 1111mp/nvmd-command that referenced this issue Oct 17, 2024
@1111mp
Copy link
Owner

1111mp commented Oct 18, 2024

This issue has been fixed in Release v4.0.2. You can upgrade to this version to verify it. Thanks. 🌹

@1111mp 1111mp closed this as completed Oct 18, 2024
@iki
Copy link
Author

iki commented Oct 20, 2024

Works perfectly! Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants