npm-README.1 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. .TH "NPM" "1" "August 2021" "" ""
  2. .SH "NAME"
  3. \fBnpm\fR \- a JavaScript package manager
  4. .P
  5. Build Status \fIhttps://img\.shields\.io/travis/npm/cli/latest\.svg\fR \fIhttps://travis\-ci\.org/npm/cli\fR
  6. .SH SYNOPSIS
  7. .P
  8. This is just enough info to get you up and running\.
  9. .P
  10. Much more info will be available via \fBnpm help\fP once it's installed\.
  11. .SH IMPORTANT
  12. .P
  13. \fBYou need node v6 or higher to run this program\.\fR
  14. .P
  15. To install an old \fBand unsupported\fR version of npm that works on node v5
  16. and prior, clone the git repo and dig through the old tags and branches\.
  17. .P
  18. \fBnpm is configured to use npm, Inc\.'s public registry at
  19. https://registry\.npmjs\.org by default\.\fR Use of the npm public registry
  20. is subject to terms of use available at https://www\.npmjs\.com/policies/terms\|\.
  21. .P
  22. You can configure npm to use any compatible registry you
  23. like, and even run your own registry\. Check out the doc on
  24. registries \fIhttps://docs\.npmjs\.com/misc/registry\fR\|\.
  25. .SH Super Easy Install
  26. .P
  27. npm is bundled with node \fIhttps://nodejs\.org/en/download/\fR\|\.
  28. .SS Windows Computers
  29. .P
  30. Get the MSI \fIhttps://nodejs\.org/en/download/\fR\|\. npm is in it\.
  31. .SS Apple Macintosh Computers
  32. .P
  33. Get the pkg \fIhttps://nodejs\.org/en/download/\fR\|\. npm is in it\.
  34. .SS Other Sorts of Unices
  35. .P
  36. Run \fBmake install\fP\|\. npm will be installed with node\.
  37. .P
  38. If you want a more fancy pants install (a different version, customized
  39. paths, etc\.) then read on\.
  40. .SH Fancy Install (Unix)
  41. .P
  42. There's a pretty robust install script at
  43. https://www\.npmjs\.com/install\.sh\|\. You can download that and run it\.
  44. .P
  45. Here's an example using curl:
  46. .P
  47. .RS 2
  48. .nf
  49. curl \-L https://www\.npmjs\.com/install\.sh | sh
  50. .fi
  51. .RE
  52. .SS Slightly Fancier
  53. .P
  54. You can set any npm configuration params with that script:
  55. .P
  56. .RS 2
  57. .nf
  58. npm_config_prefix=/some/path sh install\.sh
  59. .fi
  60. .RE
  61. .P
  62. Or, you can run it in uber\-debuggery mode:
  63. .P
  64. .RS 2
  65. .nf
  66. npm_debug=1 sh install\.sh
  67. .fi
  68. .RE
  69. .SS Even Fancier
  70. .P
  71. Get the code with git\. Use \fBmake\fP to build the docs and do other stuff\.
  72. If you plan on hacking on npm, \fBmake link\fP is your friend\.
  73. .P
  74. If you've got the npm source code, you can also semi\-permanently set
  75. arbitrary config keys using the \fB\|\./configure \-\-key=val \.\.\.\fP, and then
  76. run npm commands by doing \fBnode bin/npm\-cli\.js <command> <args>\fP\|\. (This is helpful
  77. for testing, or running stuff without actually installing npm itself\.)
  78. .SH Windows Install or Upgrade
  79. .P
  80. Many improvements for Windows users have been made in npm 3 \- you will have a better
  81. experience if you run a recent version of npm\. To upgrade, either use Microsoft's
  82. upgrade tool \fIhttps://github\.com/felixrieseberg/npm\-windows\-upgrade\fR,
  83. download a new version of Node \fIhttps://nodejs\.org/en/download/\fR,
  84. or follow the Windows upgrade instructions in the
  85. Installing/upgrading npm \fIhttps://npm\.community/t/installing\-upgrading\-npm/251/2\fR post\.
  86. .P
  87. If that's not fancy enough for you, then you can fetch the code with
  88. git, and mess with it directly\.
  89. .SH Installing on Cygwin
  90. .P
  91. No\.
  92. .SH Uninstalling
  93. .P
  94. So sad to see you go\.
  95. .P
  96. .RS 2
  97. .nf
  98. sudo npm uninstall npm \-g
  99. .fi
  100. .RE
  101. .P
  102. Or, if that fails,
  103. .P
  104. .RS 2
  105. .nf
  106. sudo make uninstall
  107. .fi
  108. .RE
  109. .SH More Severe Uninstalling
  110. .P
  111. Usually, the above instructions are sufficient\. That will remove
  112. npm, but leave behind anything you've installed\.
  113. .P
  114. If you would like to remove all the packages that you have installed,
  115. then you can use the \fBnpm ls\fP command to find them, and then \fBnpm rm\fP to
  116. remove them\.
  117. .P
  118. To remove cruft left behind by npm 0\.x, you can use the included
  119. \fBclean\-old\.sh\fP script file\. You can run it conveniently like this:
  120. .P
  121. .RS 2
  122. .nf
  123. npm explore npm \-g \-\- sh scripts/clean\-old\.sh
  124. .fi
  125. .RE
  126. .P
  127. npm uses two configuration files, one for per\-user configs, and another
  128. for global (every\-user) configs\. You can view them by doing:
  129. .P
  130. .RS 2
  131. .nf
  132. npm config get userconfig # defaults to ~/\.npmrc
  133. npm config get globalconfig # defaults to /usr/local/etc/npmrc
  134. .fi
  135. .RE
  136. .P
  137. Uninstalling npm does not remove configuration files by default\. You
  138. must remove them yourself manually if you want them gone\. Note that
  139. this means that future npm installs will not remember the settings that
  140. you have chosen\.
  141. .SH More Docs
  142. .P
  143. Check out the docs \fIhttps://docs\.npmjs\.com/\fR\|\.
  144. .P
  145. You can use the \fBnpm help\fP command to read any of them\.
  146. .P
  147. If you're a developer, and you want to use npm to publish your program,
  148. you should read this \fIhttps://docs\.npmjs\.com/misc/developers\fR\|\.
  149. .SH BUGS
  150. .P
  151. When you find issues, please report them:
  152. .RS 0
  153. .IP \(bu 2
  154. web:
  155. https://npm\.community/c/bugs
  156. .RE
  157. .P
  158. Be sure to include \fIall\fR of the output from the npm command that didn't work
  159. as expected\. The \fBnpm\-debug\.log\fP file is also helpful to provide\.
  160. .SH SEE ALSO
  161. .RS 0
  162. .IP \(bu 2
  163. npm(1)
  164. .IP \(bu 2
  165. npm\-help(1)
  166. .RE