Closed 1111mp closed 7 months ago
卸载后仍然出现nvm-desktop: command not found:node,这个如何解决?
@rmd1710714107 根据文档完全卸载
nvm-desktop
: uninstall
感谢,已解决
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
This issue aims to explain why the
nvm-desktop: command not found
prompt message appears. Only applies to the following two situations:prefix
option ofnpm
. (npm config set prefix "/path/to/folder"
) That is the directory of the "npm" global installation package has been changed.yarn
orpnpm
throughcorepack
. (corepack enable --install-directory /path/to/folder
) The directory where the executable is generated was changed via the--install-directory
option.Therefore, the error prompt of
nvm-desktop: command not found
in the terminal is in line with its respective default behavior. At this time, you need to manually add the/path/to/folder
directory path to the system environment variable, and then terminal can be correctly identified. However, please note that when adding it to the system environment variable, you need to put the path of/path/to/folder
beforenvmd
($HOME/.nvmd/bin
).You can download a node version separately to test its respective default behavior without using
nvm-desktop
.这个 issue 旨在解释为何出现
nvm-desktop: command not found
提示信息。 只适用于以下两种情况:npm
的prefix
选项。 (npm config set prefix "/path/to/folder"
) 即npm
全局安装包的目录已更改。corepack
使用yarn
或pnpm
时。 (corepack enable --install-directory /path/to/folder
) 通过--install-directory
选项更改了可执行文件生成的目录。终端中出现
nvm-desktop: command not find
的错误提示符合其各自的默认行为的。 这时需要手动将/path/to/folder
目录路径添加到系统环境变量中,然后终端才能正确识别。不过请注意,在添加到系统环境变量的时候,需要将/path/to/folder
的路径放在nvmd
($HOME/.nvmd/bin
) 之前。你可以在不使用
nvm-desktop
的情况下单独下载一个node的版本到本地进行测试。当更改过npm
的全局包安装路径以及通过corepack enable --install-directory /path/to/folder
命令生成yarn
&pnpm
的可执行文件时,需要将其对应的路径添加到环境变量中之后终端才能够正确识别。Reference: