diff options
author | Daijiro Wachi <daijiro.wachi@gmail.com> | 2016-12-07 23:39:03 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2016-12-15 03:32:51 +0300 |
commit | 23595055669f76c9fe8f5f1cf4a705c2e794f0dc (patch) | |
tree | 9ad45b8668ce436d0a9b04eaea47efa11e966979 /doc | |
parent | 0209ee50448441695fbf9699019d34178b69ba73 (diff) |
doctor: add new subcommand
This command will diagnose user's environment and let
the user know some recommended solutions if they
potentially have any problems related to npm.
Credit: @watilde
Reviewed-By: @othiym23
Reviewed-By: @iarna
PR-URL: https://github.com/npm/npm/pull/14582
Fixes: #6756
Diffstat (limited to 'doc')
-rw-r--r-- | doc/cli/npm-doctor.md | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/doc/cli/npm-doctor.md b/doc/cli/npm-doctor.md new file mode 100644 index 000000000..48e653b16 --- /dev/null +++ b/doc/cli/npm-doctor.md @@ -0,0 +1,44 @@ +npm-doctor(1) -- Check your environments +======================================================== + +## SYNOPSIS + + npm doctor + +## DESCRIPTION + +npm command is just a single command, but depends on several things outside +the code base. Broadly speaking, it is the following three types: + ++ Technology stack: Node.js, git ++ Registry: `registry.npmjs.com` ++ Files: `node_modules` in local/global, cached files in `npm config get cache` + +Without all of these working properly, the npm command will not work properly. +Many issue reports that arrive under us are often attributable to things that +are outside the code base as described above, and it is necessary to confirm +that this is correctly set with one command would help you solve your issue. +Also, in addition to this, there are also very many issue reports due to using +old versions of npm. Since npm is constantly improving, in every aspect the +`latest` npm is better than the old version(it should be, and we are trying). + +From the above reasons, `npm doctor` will investigate the following items in +your environment and if there are any other recommended settings, it will +display the recommended example. + +|What to check|What we recommend| +|---|---| +|`npm ping`|It must be able to communicate with the registry| +|`npm -v`|It is preferable that the latest version of LTS is used| +|`node -v`|It is preferable that the latest version of LTS is used| +|`npm config get registry`|In order not to consider exceptions, it is better to set default values `registry.npmjs.org`| +|`which git`|Git has to be installed| +|`Perms check on cached files`|All cached module files must be readable.| +|`Perms check on global node_modules`|All global module files must be executable.| +|`Perms check on local node_modules`|All local module files must be executable.| +|`Checksum cached files`|All cached files must not be broken| + +## SEE ALSO + +* npm-bugs(1) +* npm-help(1) |