banner
Lainbo

Lainbo's Blog

github

Using nvm-desktop

After using windows-nvm and volta, I discovered a new node version management tool. After trying it for a while, I feel that it is the best Node version management tool I have ever used.

First, I want to talk about why I gave up on some "useful" Node version management tools and state the problems that exist.

Issues with Volta#

  1. Unable to see global packages

    I use antfu's taze and @antfu/ni to quickly upgrade project dependencies. If there is a package called pnpm globally (visible through npm list -g --depth 0), I can quickly upgrade dependencies by pressing Enter all the way. However, with Volta, not only pnpm, but also yarn cannot be seen globally. When I use taze, it prompts me that I may not have installed pnpm or yarn and asks if I want to install them globally. This interruption in my behavior of pressing Enter all the way creates a sense of disconnection that is infinitely magnified when it happens multiple times.

  2. Poor compatibility with pnpm

    Among the three commonly used package managers, npm, yarn, and pnpm, pnpm provides the best experience. However, Volta's support for pnpm is currently only at the "experimental" level, which is somewhat unsatisfactory.

  3. Poor compatibility with some npm library check tools

    For example, npm-check-updates used to check project dependency versions and ni used to automatically invoke package manager commands. These useful tools have reported some errors with Volta that have not been resolved to this day (error report, related issue).

  4. Slow update speed

    Although I can see continuous commits on GitHub, the last release update was in January 2023. This is also the reason why I started looking for alternatives.

  5. No uninstallation functionality

    When using Volta to upgrade from 18.18.0 to 18.19.0, it simply installs a new version. If you prefer to keep up with version updates, you will have many similar versions on your computer (of course, you can manually delete them from the directory, but that's not very primitive, is it?)

Issues with nvm#

  1. nvm does not have a Windows version. The one used on Windows is called nvm-windows.

Issues with nvm-windows#

  1. Does not support automatic switching of Node versions based on projects. This means that you need to manually switch Node versions using commands when switching projects. The author has also stated that they will not provide support for this feature in this project. You can see the author's exact words in this link.
  2. Although the author stated that they will not add automatic switching to this project, they have started a new project to improve this issue. However, this project is still unfinished. You can find more information in the link: https://github.com/coreybutler/nvm-windows/wiki/Runtime

Issues with pnpm for managing Node versions#

  1. pnpm can also manage Node versions by installing pnpm through a script:

    iwr https://get.pnpm.io/install.ps1 -useb | iex,

    and then using pnpm env use --global 18 to manage Node. However, I gave up after using it for a few hours because it still has many bugs and cannot be used for daily purposes.

The protagonist of this article - nvm desktop#

nvm desktop is a desktop application that manages multiple Node versions through a visual interface. It has the following advantages:

  1. Automatically switches Node versions based on projects. Set it up once and it will work without intervention in the future. It does not need to run in the background.
  2. Based on Electron, it provides a highly consistent experience across multiple platforms.
  3. Powered by nvmd-command, written in Rust.
  4. Visual operations are easier to learn.
  5. Retains the command-line operations of nvm, but changes the command from nvm xxx to nvmd xxx.
  6. Fewer compatibility issues.

Based on these advantages, nvm desktop is a good Node version management solution for team collaboration.

Software Screenshots#

List all available Node versions and support switching to the Ali source

image

Manage installed Node versions

image

Specify Node versions for projects. If not specified, it uses the global Node version

image

https://github.com/1111mp/nvm-desktop/releases/latest

There is nothing specific to note about this software, but due to some mysterious issues, I recommend completely uninstalling Node, nvm, Volta, and similar software from your computer. After restarting your computer, you can install nvm-desktop.

If you are switching from other management tools#

I recommend checking the environment variables on your device. Some tools may leave behind environment variables even after uninstallation, which can cause unexpected errors. It is recommended to clean them up (for example, if you have installed Volta and then installed npm-check-updates, you will be notified to disable global checks because of this line of code).

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.