Welcome to mirror list, hosted at ThFree Co, Russian Federation.

npm-publish.1 « man1 « man « npm « deps - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fdcdbd0c044cc6317950cffc0c081ce4defaaf64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
.TH "NPM\-PUBLISH" "1" "February 2021" "" ""
.SH "NAME"
\fBnpm-publish\fR \- Publish a package
.SS Synopsis
.P
.RS 2
.nf
npm publish [<tarball>|<folder>] [\-\-tag <tag>] [\-\-access <public|restricted>] [\-\-otp otpcode] [\-\-dry\-run]

Publishes '\.' if no argument supplied
Sets tag 'latest' if no \-\-tag specified
.fi
.RE
.SS Description
.P
Publishes a package to the registry so that it can be installed by name\.
.P
By default npm will publish to the public registry\. This can be overridden
by specifying a different default registry or using a
npm help \fBscope\fP in the name (see
npm help \fBpackage\.json\fP)\.
.RS 0
.IP \(bu 2
\fB<folder>\fP: A folder containing a package\.json file
.IP \(bu 2
\fB<tarball>\fP: A url or file path to a gzipped tar archive containing a
single folder with a package\.json file inside\.
.IP \(bu 2
\fB[\-\-tag <tag>]\fP: Registers the published package with the given tag, such
that \fBnpm install <name>@<tag>\fP will install this version\.  By default,
\fBnpm publish\fP updates and \fBnpm install\fP installs the \fBlatest\fP tag\. See
\fBnpm\-dist\-tag\fP \fInpm\-dist\-tag\fR for details about tags\.
.IP \(bu 2
\fB[\-\-access <public|restricted>]\fP: Tells the registry whether this package
should be published as public or restricted\. Only applies to scoped
packages, which default to \fBrestricted\fP\|\.  If you don't have a paid
account, you must publish with \fB\-\-access public\fP to publish scoped
packages\.
.IP \(bu 2
\fB[\-\-otp <otpcode>]\fP: If you have two\-factor authentication enabled in
\fBauth\-and\-writes\fP mode then you can provide a code from your
authenticator with this\. If you don't include this and you're running
from a TTY then you'll be prompted\.
.IP \(bu 2
\fB[\-\-dry\-run]\fP: As of \fBnpm@6\fP, does everything publish would do except
actually publishing to the registry\. Reports the details of what would
have been published\.

.RE
.P
The publish will fail if the package name and version combination already
exists in the specified registry\.
.P
Once a package is published with a given name and version, that specific
name and version combination can never be used again, even if it is removed
with npm help \fBunpublish\fP\|\.
.P
As of \fBnpm@5\fP, both a sha1sum and an integrity field with a sha512sum of the
tarball will be submitted to the registry during publication\. Subsequent
installs will use the strongest supported algorithm to verify downloads\.
.P
Similar to \fB\-\-dry\-run\fP see npm help \fBpack\fP, which figures
out the files to be included and packs them into a tarball to be uploaded
to the registry\.
.SS Files included in package
.P
To see what will be included in your package, run \fBnpx npm\-packlist\fP\|\.  All
files are included by default, with the following exceptions:
.RS 0
.IP \(bu 2
Certain files that are relevant to package installation and distribution
are always included\.  For example, \fBpackage\.json\fP, \fBREADME\.md\fP,
\fBLICENSE\fP, and so on\.
.IP \(bu 2
If there is a "files" list in
npm help \fBpackage\.json\fP, then only the files
specified will be included\.  (If directories are specified, then they
will be walked recursively and their contents included, subject to the
same ignore rules\.)
.IP \(bu 2
If there is a \fB\|\.gitignore\fP or \fB\|\.npmignore\fP file, then ignored files in
that and all child directories will be excluded from the package\.  If
\fIboth\fR files exist, then the \fB\|\.gitignore\fP is ignored, and only the
\fB\|\.npmignore\fP is used\.
\fB\|\.npmignore\fP files follow the same pattern
rules \fIhttps://git\-scm\.com/book/en/v2/Git\-Basics\-Recording\-Changes\-to\-the\-Repository#_ignoring\fR
as \fB\|\.gitignore\fP files
.IP \(bu 2
If the file matches certain patterns, then it will \fInever\fR be included,
unless explicitly added to the \fB"files"\fP list in \fBpackage\.json\fP, or
un\-ignored with a \fB!\fP rule in a \fB\|\.npmignore\fP or \fB\|\.gitignore\fP file\.
.IP \(bu 2
Symbolic links are never included in npm packages\.

.RE
.P
See 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\.
.SS See Also
.RS 0
.IP \(bu 2
npm\-packlist package \fIhttp://npm\.im/npm\-packlist\fR
.IP \(bu 2
npm help registry
.IP \(bu 2
npm help scope
.IP \(bu 2
npm help adduser
.IP \(bu 2
npm help owner
.IP \(bu 2
npm help deprecate
.IP \(bu 2
npm help dist\-tag
.IP \(bu 2
npm help pack
.IP \(bu 2
npm help profile

.RE