macOS
brew install nlocal Homebrew formula metadata
安装
brew install nlocal Homebrew formula metadata
概览
Node version management
历史
n is a long-lived Node.js version manager by TJ Holowaychuk. The GitHub repository and npm package both date to January 5, 2011, placing it in the early era when Node users needed fast local switching between rapidly moving Node releases. It remains a small, Unix-style tool rather than a broader runtime manager: install a version, keep downloaded versions in a cache, and switch the active Node in place.
The project is implemented primarily as shell code and distributed through npm, Homebrew, MacPorts, and direct script installation. Release v10.2.0 was published on GitHub on May 21, 2025 and is also the stable Homebrew version. The project has continued to adapt to Node ecosystem changes, including LTS aliases, package.json engine resolution, custom mirrors, alternate architectures, and preservation of npm/corepack during Node installs.
n has broad practical adoption among developers who want a simpler alternative to shell-integrating version managers. The GitHub API showed 19,516 stars and 764 forks on July 1, 2026. npm reported 1,667,021 downloads for May 30, 2026 through June 28, 2026, and Homebrew reported 9,495 installs in the preceding 365 days. Those numbers reflect different distribution channels: npm is the dominant installation path, while Homebrew remains a convenient macOS/Linux route.
The common workflow is `n lts`, `n latest`, or `n 20` to install and switch Node, with bare `n` opening the interactive selector over cached versions. Package nerds use `n run`, `n exec`, and `n which` when they need to run commands under a cached Node without changing the active install. The `engine` label is useful in repos that declare a Node range in package.json, while `N_NODE_MIRROR`, `N_ARCH`, `--offline`, and `--cleanup` cover mirrors, architecture-specific downloads, air-gapped/cache use, and container one-shot installs.
n matters because it is intentionally narrow: it manages Node versions without trying to own the whole shell session or project environment. That makes it especially handy on CI images, disposable containers, remote shells, and machines where a global Node install is acceptable. The tradeoff is also the reason people still compare it with nvm/fnm/asdf/Volta: n changes the active installed Node rather than providing per-directory shims by default.
安全态势
narrow executable package without higher-risk signals.
绿色 风险 · 低 置信度 · appliance
在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。
可执行文件
| 命令 | 类型 | 暴露范围 | 备注 |
|---|---|---|---|
n | cli | 全局可执行文件 |
新鲜度
这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。
安装元数据
| 软件包键 | brew:n |
|---|---|
| 版本 | 10.2.0 |
| 软件包管理器 | Homebrew |
| 软件包管理器页面 | https://formulae.brew.sh/formula/n |
| 主页 | https://github.com/tj/n |
| 仓库 | https://github.com/tj/n |
| 上游文档 | https://github.com/tj/n#readme |
| 许可证 | MIT |
| 源码归档 | https://github.com/tj/n/archive/refs/tags/v10.2.0.tar.gz |
| Bottle | 可用 (于 all) |
| Homebrew post-install | 未定义 |
| 服务 | 未声明 |
注册表事实
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | n |
| Version Scheme | 0 |
| Revision | 0 |
| Head Version | HEAD |
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
源数据库匹配
匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。
n
sudo port install n来源线索
此页面由 av-web 从 scripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。
View the package source record on GitHub.