npm-publish.1 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. .TH "NPM\-PUBLISH" "1" "August 2021" "" ""
  2. .SH "NAME"
  3. \fBnpm-publish\fR \- Publish a package
  4. .SS Synopsis
  5. .P
  6. .RS 2
  7. .nf
  8. npm publish [<tarball>|<folder>] [\-\-tag <tag>] [\-\-access <public|restricted>] [\-\-otp otpcode] [\-\-dry\-run]
  9. Publishes '\.' if no argument supplied
  10. Sets tag 'latest' if no \-\-tag specified
  11. .fi
  12. .RE
  13. .SS Description
  14. .P
  15. Publishes a package to the registry so that it can be installed by name\. All
  16. files in the package directory are included if no local \fB\|\.gitignore\fP or
  17. \fB\|\.npmignore\fP file exists\. If both files exist and a file is ignored by
  18. \fB\|\.gitignore\fP but not by \fB\|\.npmignore\fP then it will be included\. See
  19. npm help \fBdevelopers\fP for full details on what's included in the published package, as well as details on how the package is built\.
  20. .P
  21. By default npm will publish to the public registry\. This can be overridden by
  22. specifying a different default registry or using a npm help \fBscope\fP in the name (see npm help \fBpackage\.json\fP)\.
  23. .RS 0
  24. .IP \(bu 2
  25. \fB<folder>\fP:
  26. A folder containing a package\.json file
  27. .IP \(bu 2
  28. \fB<tarball>\fP:
  29. A url or file path to a gzipped tar archive containing a single folder
  30. with a package\.json file inside\.
  31. .IP \(bu 2
  32. \fB[\-\-tag <tag>]\fP
  33. Registers the published package with the given tag, such that \fBnpm install
  34. <name>@<tag>\fP will install this version\. By default, \fBnpm publish\fP updates
  35. and \fBnpm install\fP installs the \fBlatest\fP tag\. See \fBnpm\-dist\-tag\fP \fInpm\-dist\-tag\fR for
  36. details about tags\.
  37. .IP \(bu 2
  38. \fB[\-\-access <public|restricted>]\fP
  39. Tells the registry whether this package should be published as public or
  40. restricted\. Only applies to scoped packages, which default to \fBrestricted\fP\|\.
  41. If you don't have a paid account, you must publish with \fB\-\-access public\fP
  42. to publish scoped packages\.
  43. .IP \(bu 2
  44. \fB[\-\-otp <otpcode>]\fP
  45. If you have two\-factor authentication enabled in \fBauth\-and\-writes\fP mode
  46. then you can provide a code from your authenticator with this\. If you
  47. don't include this and you're running from a TTY then you'll be prompted\.
  48. .IP \(bu 2
  49. \fB[\-\-dry\-run]\fP
  50. As of \fBnpm@6\fP, does everything publish would do except actually publishing
  51. to the registry\. Reports the details of what would have been published\.
  52. .RE
  53. .P
  54. Fails if the package name and version combination already exists in
  55. the specified registry\.
  56. .P
  57. Once a package is published with a given name and version, that
  58. specific name and version combination can never be used again, even if
  59. it is removed with npm help \fBunpublish\fP\|\.
  60. .P
  61. As of \fBnpm@5\fP, both a sha1sum and an integrity field with a sha512sum of the
  62. tarball will be submitted to the registry during publication\. Subsequent
  63. installs will use the strongest supported algorithm to verify downloads\.
  64. .P
  65. Similar to \fB\-\-dry\-run\fP see npm help \fBpack\fP, which figures out the files to be
  66. included and packs them into a tarball to be uploaded to the registry\.
  67. .SS See Also
  68. .RS 0
  69. .IP \(bu 2
  70. npm help registry
  71. .IP \(bu 2
  72. npm help scope
  73. .IP \(bu 2
  74. npm help adduser
  75. .IP \(bu 2
  76. npm help owner
  77. .IP \(bu 2
  78. npm help deprecate
  79. .IP \(bu 2
  80. npm help dist\-tag
  81. .IP \(bu 2
  82. npm help pack
  83. .IP \(bu 2
  84. npm help profile
  85. .RE