npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

autonvm

v1.0.2

Published

自动切换Node.js版本的工具,根据项目.npmrc配置文件中的use-node-version自动下载并使用指定版本的Node.js

Readme

AutoNVM

自动切换Node.js版本的工具,根据项目.npmrc配置文件中的use-node-version自动下载并使用指定版本的Node.js。

特性

  • 根据项目.npmrc配置自动切换Node.js版本
  • 支持MacOS和Windows系统
  • 自动下载和安装所需的Node.js版本
  • 项目级别的Node.js版本隔离
  • 简单易用的命令行接口
  • 支持npm、pnpm和npx命令

安装

npm install -g autonvm

配置项目

在项目根目录创建或编辑.npmrc文件,添加以下配置:

use-node-version=14.17.0  # 替换为你需要的Node.js版本

命令行工具

显示当前项目配置的Node.js版本

autonvm show

此命令会显示当前项目在.npmrc文件中配置的Node.js版本,并检查该版本是否已安装。

列出已安装的Node.js版本

autonvm list

此命令会列出所有已安装的Node.js版本,并用箭头(→)标记当前项目正在使用的版本。

输出示例:

已安装的Node.js版本:
→ v16.15.0 (当前项目)
  v14.17.0

提示:
  → 标记的版本为当前项目配置的版本
  使用 autonvm install <版本> 安装新版本
  使用 autonvm remove <版本> 删除版本

安装指定版本的Node.js

autonvm install <版本>

例如:

autonvm install 14.17.0

此命令会下载并安装指定版本的Node.js。如果该版本已经安装,则会提示已安装。

检查指定版本的Node.js是否已安装

autonvm check <版本>

例如:

autonvm check 14.17.0

此命令会检查指定版本的Node.js是否已安装,并显示检查结果。

删除指定版本的Node.js

autonvm remove <版本>

例如:

autonvm remove 14.17.0

此命令会删除指定版本的Node.js。如果该版本未安装,则会提示未安装。

使用项目配置的Node.js版本运行命令

# 运行Node.js REPL
autonvm

# 运行JavaScript文件
autonvm app.js

# 运行npm命令
autonvm npm install
autonvm npm start

# 运行pnpm命令
autonvm pnpm install
autonvm pnpm dev

# 运行npx命令
autonvm npx create-react-app my-app

工作原理

  1. 读取项目根目录下的.npmrc文件中的use-node-version配置
  2. 检查指定版本的Node.js是否已安装,如果没有则自动下载并安装
  3. 使用指定版本的Node.js运行命令,不影响全局Node.js环境

版本管理

AutoNVM将下载的Node.js版本存储在用户主目录的.autonvm/versions目录下,每个版本都有独立的目录,不会相互影响。

支持的系统

  • MacOS (x64, arm64)
  • Windows (x64, x86)

注意事项

  • 首次使用某个版本时,需要下载并安装,可能需要一些时间
  • 确保你的项目根目录有正确配置的.npmrc文件
  • 对于npx命令,AutoNVM会使用系统的npx命令,但会在项目指定的Node.js环境中执行

前端应用集成

如果你想将AutoNVM集成到前端应用的开发流程中,请参考集成指南

许可证

MIT