Configs2026年7月14日·1 分钟阅读

npm-check — Find Outdated, Incorrect, and Unused Dependencies

npm-check gives you a clear interactive overview of outdated, incorrect, and unused dependencies in your Node.js project, with one-command upgrade support.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
npm-check
直接安装命令
npx -y tokrepo@latest install a48d0142-7f3c-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

npm-check inspects your project's dependencies and reports which ones are outdated, which are unused in your code, and which are missing from package.json. Its interactive update mode lets you selectively upgrade packages with a checkbox interface.

What npm-check Does

  • Checks all dependencies against the npm registry for newer versions available
  • Detects unused dependencies by scanning your source files for require/import statements
  • Identifies missing dependencies that are imported but not listed in package.json
  • Flags packages with mismatched installed versions versus package.json declarations
  • Provides an interactive terminal UI for selectively updating packages

Architecture Overview

npm-check reads your package.json and node_modules to determine installed versions, queries the npm registry for latest versions, and uses depcheck internally to scan source files for actual usage. It aggregates results into a categorized report and optionally presents an interactive inquirer-based UI for choosing updates.

Self-Hosting & Configuration

  • Install globally: npm install -g npm-check, or run via npx
  • Run npm-check in your project root for a full report
  • Use -u or --update for the interactive update interface
  • Pass -g to check globally installed packages
  • Skip unused-dependency detection with --skip-unused if it produces false positives

Key Features

  • Color-coded terminal output categorizing packages by status (outdated, unused, missing, warning)
  • Interactive update mode with checkbox selection for each package
  • Links to each package's homepage and changelog for reviewing what changed
  • Global package checking with the -g flag
  • Supports custom ignore patterns for packages you want to exclude from the report

Comparison with Similar Tools

  • npm outdated — Built-in npm command showing outdated packages but no unused detection or interactive upgrade
  • npm-check-updates — Focuses on version bumping in package.json; npm-check also detects unused and missing dependencies
  • depcheck — Dedicated unused dependency finder; npm-check bundles this with version checking and interactive upgrades
  • Renovate / Dependabot — Automated PR-based update bots; npm-check is a local interactive CLI tool

FAQ

Q: How does npm-check detect unused packages? A: It uses depcheck internally, which scans your source files, configuration files, and scripts for require/import references to each installed dependency.

Q: Can I use it in CI to fail on outdated dependencies? A: npm-check returns a non-zero exit code when outdated or problematic packages are found, so you can use it as a CI check.

Q: What if it reports false positives for unused packages? A: Some packages are used implicitly (e.g., Babel plugins, webpack loaders). Use --skip-unused or add them to the ignore list in a .npmcheckrc file.

Q: Does it work with yarn or pnpm? A: npm-check reads package.json and node_modules, so it works with any package manager. However, the interactive update uses npm commands by default.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产