nvm-desktop-超好用的可视化node版本管理工具

概述

nvm-desktop 是一个桌面应用程序,通过可视化界面帮助你管理多个 Node.js 版本。应用程序使用 Tauri 构建,支持 macOS、Windows 以及 Linux 系统。可以轻松快速地安装、管理并切换不同的 Node.js 版本,而无需依赖操作系统的任何特定功能和 shell。
程序还支持在不同项目间独立设置和切换 Node.js 版本。每个版本间的环境是相互隔离的,这意味着在一个版本下通过 npm 安装的全局依赖,在切换到另一个版本后将不可用。如需共享这些全局依赖,可以使用 npm config set prefix “/path/to/folder” 命令,将全局包安装到指定目录。在切换 Node.js 版本时,所有版本都可以使用该路径下的包。

功能

支持为系统全局和项目单独设置 Node 引擎版本
管理 Node 的命令行工具
支持英文和简体中文
支持自定义下载镜像地址 (默认是 https://nodejs.org/dist)
自动检查更新

下载

Github下载地址
支持多个平台
在这里插入图片描述
安装 (省略)下一步即可
在这里插入图片描述

推荐安装到非系统盘 避免文件目录权限问题

设置

环境变量设置
在这里插入图片描述

注意:一定在 %NVMD_DIR%\bin 前面
D:\programe \nvm-desktop\node_global
缓存设置




npm config set prefix "D:\ProgramFiles\nvmdesktop\nvm-desktop\node_global"
npm config set cache "D:\ProgramFiles\nvmdesktop\nvm-desktop\node_cache"
npm config set registry "https://registry.npmmirror.com"
npm config get prefix
npm config get cache

#npm install -g cnpm --registry=https://registry.npmmirror.com
#cnpm install -g yarn

# 安装yarn 和查看版本
npm install yarn -g
yarn -v



yarn config set registry https://registry.npmmirror.com -g
yarn config set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass -g

# 自定义缓存路径命令:
yarn config set cache-folder "D:\ProgramFiles\nvmdesktop\nvm-desktop\yarn_cache"
# 自定义下载路径命令:
yarn config set global-folder "D:\ProgramFiles\nvmdesktop\nvm-desktop\yarn_global"
yarn config set prefix "D:\ProgramFiles\nvmdesktop\nvm-desktop\yarn_global"
# 查看缓存路径:
yarn config get cache-folder
# 查看下载路径
yarn global bin










nvm设置

可配置nodejs 安装目录和下载镜像地址(我这里使用阿里云镜像(https://mirrors.aliyun.com/nodejs-release))

在这里插入图片描述

安装node版本

在这里插入图片描述

在这里插入图片描述

指定node版本下载好后 可以看到配置的安装目录下有已下载对应版本
在这里插入图片描述
下载后点击应用 可以把当前版本设置为全局默认的版本
在这里插入图片描述

nvmd

nvmd命令是一个单一的、快速的本机可执行文件,没有外部依赖,用Rust构建。Node和Npm的代理,通过它可以智能(快速)识别Node引擎的正确版本。为nvm-desktop的Node引擎版本管理功能提供服务。您还可以直接从命令行管理node的所有版本。但是,如果需要下载并安装新版本的node,则应该打开nvm-desktop应用程序。

nvmd允许您通过命令行快速管理不同版本的node。

$ nvmd use 18.17.1
Now using node v18.17.1
$ node -v
v18.17.1
$ nvmd use v20.5.1 --project
Now using node v20.5.1
$ node -v
v20.5.1
$ nvmd ls
v20.6.1
v20.5.1 (currently)
v18.17.1
$ nvmd current
v20.5.1
$ nvmd --help
nvmd (2.2.0)
The1111mp@outlook.com
command tools for nvm-desktop

Usage: nvmd [COMMAND]

Commands:
  current  Get the currently used version
  list     List the all installed versions of Node.js
  ls       List the all installed versions of Node.js
  use      Use the installed version of Node.js (default is global)
  which    Get the path to the executable to where Node.js was installed
  help     Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

Please download new version of Node.js in nvm-desktop.

nvm-desktop也支持通过命令行工具直接管理所有的 Nodejs 版本:nvmd. 在你的终端输入 nvmd --help 以查看更多信息。
切换 Node 版本之后,默认不需要重新打开你的终端就能够生效
在这里,你可以更改 Nodejs 的默认安装目录。
请注意,nvm-desktop 不会跟踪您所使用过的所有的目录,这意味着您每次更改安装目录之后都需要重新下载 Nodejs。 但是你可以手动将之前目录下下载的所有 Nodejs 文件移动到新的目录下。
之所以这么设计是为了避免过多的文件检索从而影响 nvm-command 在性能上的表现。
你可以为项目单独选择你想要的 Node 的版本。
或者你也可以通过命令行为你的项目指定nodejs版本 nvmd use node_version --project
在项目的根目录下会添加一个文件: .nvmdrc ,内容为你选择的 Node 的版本号,如果未添加此文件则加载为全局设置的 Node 的版本号。

参考资料

https://github.com/1111mp/nvm-desktop
https://github.com/1111mp/nvmd-command
https://github.com/1111mp/nvm-desktop/issues

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

猿与禅

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值