1111mp / nvm-desktop

Node Version Manager Desktop - A desktop application to manage multiple active node.js versions.
https://github.com/1111mp/nvm-desktop
MIT License
675 stars 34 forks source link

nvm-desktop: command not found: {lib} #23

Closed 1111mp closed 7 months ago

1111mp commented 9 months ago

This issue aims to explain why the nvm-desktop: command not found prompt message appears. Only applies to the following two situations:

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 before nvmd ($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 提示信息。 只适用于以下两种情况:

终端中出现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:

When in global mode, executables are linked into {prefix}/bin on Unix, or directly into {prefix} on Windows. Ensure that path is in your terminal's PATH environment to run them.

Corepack is a zero-runtime-dependency Node.js script that acts as a bridge between Node.js projects and the package managers they are intended to be used with during development. In practical terms, Corepack lets you use Yarn, npm, and pnpm without having to install them.

corepack enable --install-directory /path/to/folder

Add the Corepack shims to the install directories

When run, this commmand will check whether the shims for the specified package managers can be found with the correct values inside the install directory. If not, or if they don't exist, they will be created.

By default it will locate the install directory by running the equivalent of which corepack, but this can be tweaked by explicitly passing the install directory via the --install-directory flag.

rmd1710714107 commented 9 months ago

卸载后仍然出现nvm-desktop: command not found:node,这个如何解决?

1111mp commented 9 months ago

@rmd1710714107 根据文档完全卸载nvm-desktop: uninstall

rmd1710714107 commented 9 months ago

@rmd1710714107 根据文档完全卸载nvm-desktop: uninstall

感谢,已解决

github-actions[bot] commented 7 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 7 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.