Man page - npm-doctor(1)
Packages contains this manual
- npm-root(1)
- npm-explain(1)
- npm-whoami(1)
- npm-pack(1)
- npm-bugs(1)
- npm-view(1)
- npm-outdated(1)
- npm-update(1)
- npm-query(1)
- npm-logout(1)
- npm-deprecate(1)
- npm-exec(1)
- npm-ping(1)
- npm-shrinkwrap-json(5)
- npm-help(1)
- npm-prefix(1)
- npm-diff(1)
- npm-owner(1)
- npm-install(1)
- npmrc(5)
- npm-uninstall(1)
- npm-hook(1)
- npm-unstar(1)
- npm-docs(1)
- pacote(1)
- npm-restart(1)
- npm-star(1)
- npm-link(1)
- npm-test(1)
- npm-token(1)
- npm-arborist(1)
- npm-profile(1)
- npm-team(1)
- npx(1)
- npm-stars(1)
- npm-adduser(1)
- npm-cache(1)
- npm-edit(1)
- npm-doctor(1)
- npm-help-search(1)
- arborist(1)
- npm-rebuild(1)
- npm-repo(1)
- npm-publish(1)
- npm-start(1)
- npm-unpublish(1)
- npm-dedupe(1)
- npm-init(1)
- npm-dist-tag(1)
- npm-login(1)
- npm-config(1)
- npm(1)
- npm-search(1)
- npm-version(1)
- npm-org(1)
- npm-shrinkwrap(1)
- npm-ls(1)
- package-json(5)
- npm-stop(1)
- npm-install-test(1)
- npm-completion(1)
- npm-run-script(1)
- npm-prune(1)
- npm-access(1)
- npm-ci(1)
- npm-audit(1)
- npm-find-dupes(1)
- npm-install-ci-test(1)
- package-lock-json(5)
- npm-fund(1)
- npm-explore(1)
- npm-pkg(1)
- node-pacote
- node-npmcli-mock-registry
- node-npmcli-node-gyp
- node-libnpmorg
- npm
- node-libnpmteam
- node-npmcli-promise-spawn
- node-libnpmdiff
- node-npmcli-run-script
- node-npmcli-metavuln-calculator
- node-npmcli-smoke-tests
- node-libnpmpublish
- node-qrcode-terminal
- node-npmcli-config
- node-npmcli-git
- node-libnpmaccess
- node-npm-packlist
- node-npmcli-disparity-colors
- node-libnpmexec
- node-npmcli-installed-package-contents
- node-libnpmpack
- node-npmcli-map-workspaces
- node-npmcli-query
- node-npmcli-arborist
- node-npmcli-package-json
- node-libnpmhook
- node-npmcli-name-from-folder
- node-libnpmversion
- node-libnpmfund
- node-libnpmsearch
apt-get install npm
Manual
NPM-DOCTOR
NAMESynopsis
Description
npm ping
npm -v
node -v
npm config get registry
which git
Permissions checks
Validate the checksums of cached packages
Configuration
See Also
NAME
npm-doctor
Synopsis
<!-- AUTOGENERATED USAGE DESCRIPTIONS -->
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.
npm ping
By default, npm
installs from the primary npm registry,
registry.npmjs.org
.
npm doctor
hits a special
ping 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.
npm -v
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.
node -v
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.
npm config get 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.
which git
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
<!-- AUTOGENERATED CONFIG DESCRIPTIONS -->
See Also
|
⢠|
npm bugs |
|||
|
⢠|
npm help |
|||
|
⢠|
npm ping |