/usr/local/lib/node_modules/npm/docs/content/commands
NameSizeModeActions
npm-access.md28880644editdlrm
npm-adduser.md20330644editdlrm
npm-audit.md162520644editdlrm
npm-bugs.md29970644editdlrm
npm-cache.md34500644editdlrm
npm-ci.md97700644editdlrm
npm-completion.md9080644editdlrm
npm-config.md40910644editdlrm
npm-dedupe.md95430644editdlrm
npm-deprecate.md21560644editdlrm
npm-diff.md89850644editdlrm
npm-dist-tag.md51700644editdlrm
npm-docs.md29750644editdlrm
npm-doctor.md50470644editdlrm
npm-edit.md10910644editdlrm
npm-exec.md113570644editdlrm
npm-explain.md27940644editdlrm
npm-explore.md10060644editdlrm
npm-find-dupes.md67910644editdlrm
npm-fund.md36740644editdlrm
npm-get.md4450644editdlrm
npm-help-search.md7550644editdlrm
npm-help.md10030644editdlrm
npm-init.md102130644editdlrm
npm-install-ci-test.md80830644editdlrm
npm-install-test.md115730644editdlrm
npm-install.md293060644editdlrm
npm-link.md123860644editdlrm
npm-ll.md56860644editdlrm
npm-login.md23540644editdlrm
npm-logout.md17490644editdlrm
npm-ls.md71480644editdlrm
npm-org.md19740644editdlrm
npm-outdated.md69780644editdlrm
npm-owner.md30820644editdlrm
npm-pack.md38320644editdlrm
npm-ping.md7690644editdlrm
npm-pkg.md80560644editdlrm
npm-prefix.md12060644editdlrm
npm-profile.md30670644editdlrm
npm-prune.md57370644editdlrm
npm-publish.md80280644editdlrm
npm-query.md69540644editdlrm
npm-rebuild.md49940644editdlrm
npm-repo.md27550644editdlrm
npm-restart.md14440644editdlrm
npm-root.md10960644editdlrm
npm-run.md75380644editdlrm
npm-sbom.md83380644editdlrm
npm-search.md35600644editdlrm
npm-set.md14330644editdlrm
npm-shrinkwrap.md9090644editdlrm
npm-star.md17120644editdlrm
npm-stars.md7430644editdlrm
npm-start.md16320644editdlrm
npm-stop.md13200644editdlrm
npm-team.md40840644editdlrm
npm-test.md12130644editdlrm
npm-token.md49050644editdlrm
npm-trust.md100730644editdlrm
npm-undeprecate.md14060644editdlrm
npm-uninstall.md44470644editdlrm
npm-unpublish.md44910644editdlrm
npm-unstar.md15740644editdlrm
npm-update.md129720644editdlrm
npm-version.md80110644editdlrm
npm-view.md74250644editdlrm
npm-whoami.md8000644editdlrm
npm.md56380644editdlrm
npx.md62870644editdlrm
Edit: /usr/local/lib/node_modules/npm/docs/content/commands/npm-doctor.md (5047B)
--- title: npm-doctor section: 1 description: Check the health of your npm environment --- ### Synopsis ```bash npm doctor [connection] [registry] [versions] [environment] [permissions] [cache] ``` Note: This command is unaware of workspaces. ### Description `npm doctor` runs a set of checks to ensure that your npm installation has what it needs to manage your JavaScript packages. npm is mostly a standalone tool, but it does have some basic requirements that must be met: + Node.js and git must be executable by npm. + The primary npm registry, `registry.npmjs.com`, or another service that uses the registry API, is available. + The directories that npm uses, `node_modules` (both locally and globally), exist and can be written by the current user. + The npm cache exists, and the package tarballs within it aren't corrupt. Without all of these working properly, npm may not work properly. Many issues are often attributable to things that are outside npm's code base, so `npm doctor` confirms that the npm installation is in a good state. Also, in addition to this, there are also very many issue reports due to using old versions of npm. Since npm is constantly improving, running `npm@latest` is better than an old version. `npm doctor` verifies the following items in your environment, and if there are any recommended changes, it will display them. By default npm runs all of these checks. You can limit what checks are ran by specifying them as extra arguments. #### `Connecting to the registry` By default, npm installs from the primary npm registry, `registry.npmjs.org`. `npm doctor` hits a special connection testing endpoint within the registry. This can also be checked with `npm ping`. If this check fails, you may be using a proxy that needs to be configured, or may need to talk to your IT staff to get access over HTTPS to `registry.npmjs.org`. This check is done against whichever registry you've configured (you can see what that is by running `npm config get registry`), and if you're using a private registry that doesn't support the `/whoami` endpoint supported by the primary registry, this check may fail. #### `Checking npm version` While Node.js may come bundled with a particular version of npm, it's the policy of the CLI team that we recommend all users run `npm@latest` if they can. As the CLI is maintained by a small team of contributors, there are only resources for a single line of development, so npm's own long-term support releases typically only receive critical security and regression fixes. The team believes that the latest tested version of npm is almost always likely to be the most functional and defect-free version of npm. #### `Checking node version` For most users, in most circumstances, the best version of Node will be the latest long-term support (LTS) release. Those of you who want access to new ECMAscript features or bleeding-edge changes to Node's standard library may be running a newer version, and some may be required to run an older version of Node because of enterprise change control policies. That's OK! But in general, the npm team recommends that most users run Node.js LTS. #### `Checking configured npm registry` You may be installing from private package registries for your project or company. That's great! Others may be following tutorials or StackOverflow questions in an effort to troubleshoot problems you may be having. Sometimes, this may entail changing the registry you're pointing at. This part of `npm doctor` just lets you, and maybe whoever's helping you with support, know that you're not using the default registry. #### `Checking for git executable in PATH` While it's documented in the README, it may not be obvious that npm needs Git installed to do many of the things that it does. Also, in some cases – especially on Windows – you may have Git set up in such a way that it's not accessible via your `PATH` so that npm can find it. This check ensures that Git is available. #### Permissions checks * Your cache must be readable and writable by the user running npm. * Global package binaries must be writable by the user running npm. * Your local `node_modules` path, if you're running `npm doctor` with a project directory, must be readable and writable by the user running npm. #### Validate the checksums of cached packages When an npm package is published, the publishing process generates a checksum that npm uses at install time to verify that the package didn't get corrupted in transit. `npm doctor` uses these checksums to validate the package tarballs in your local cache (you can see where that cache is located with `npm config get cache`). In the event that there are corrupt packages in your cache, you should probably run `npm cache clean -f` and reset the cache. ### Configuration #### `registry` * Default: "https://registry.npmjs.org/" * Type: URL The base URL of the npm registry. ### See Also * [npm bugs](/commands/npm-bugs) * [npm help](/commands/npm-help) * [npm ping](/commands/npm-ping)