← 返回命令列表

Linux command

npm-doctor 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Run npm environment diagnostics

npm doctor

Run with a specific registry

npm doctor --registry [https://registry.npmjs.org]

说明

npm doctor runs a set of diagnostics to verify the npm environment is healthy. It checks: npm can reach the configured registry, the installed version of node and npm are supported, the npm cache is not corrupt, global and local bin directories exist and are on PATH, the packages tree has correct ownership, and the git binary is available. Each check is reported as OK or shows the specific problem. If any check fails, the exit code is non-zero.

FAQ

What is the npm-doctor command used for?

npm doctor runs a set of diagnostics to verify the npm environment is healthy. It checks: npm can reach the configured registry, the installed version of node and npm are supported, the npm cache is not corrupt, global and local bin directories exist and are on PATH, the packages tree has correct ownership, and the git binary is available. Each check is reported as OK or shows the specific problem. If any check fails, the exit code is non-zero.

How do I run a basic npm-doctor example?

Run `npm doctor` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

Where can I find more npm-doctor examples?

This page includes 2 examples for npm-doctor, plus related commands for nearby Linux tasks.