3 <title>npm-publish</title>
5 <link rel="stylesheet" type="text/css" href="../../static/style.css">
6 <link rel="canonical" href="https://www.npmjs.org/doc/cli/npm-publish.html">
7 <script async=true src="../../static/toc.js"></script>
12 <h1><a href="../cli/npm-publish.html">npm-publish</a></h1> <p>Publish a package</p>
13 <h2 id="synopsis">SYNOPSIS</h2>
14 <pre><code>npm publish <tarball> [--tag <tag>] [--access <public|restricted>]
15 npm publish <folder> [--tag <tag>] [--access <public|restricted>]
16 </code></pre><h2 id="description">DESCRIPTION</h2>
17 <p>Publishes a package to the registry so that it can be installed by name. All
18 files in the package directory are included if no local <code>.gitignore</code> or
19 <code>.npmignore</code> file is present. See <code><a href="../misc/npm-developers.html">npm-developers(7)</a></code> for full details on
20 what's included in the published package, as well as details on how the package
22 <p>By default npm will publish to the public registry. This can be overridden by
23 specifying a different default registry or using a <code><a href="../misc/npm-scope.html">npm-scope(7)</a></code> in the name
24 (see <code><a href="../files/package.json.html">package.json(5)</a></code>).</p>
26 <li><p><code><folder></code>:
27 A folder containing a package.json file</p>
29 <li><p><code><tarball></code>:
30 A url or file path to a gzipped tar archive containing a single folder
31 with a package.json file inside.</p>
33 <li><p><code>[--tag <tag>]</code>
34 Registers the published package with the given tag, such that <code>npm install
35 <name>@<tag></code> will install this version. By default, <code>npm publish</code> updates
36 and <code>npm install</code> installs the <code>latest</code> tag. See <code><a href="../cli/npm-dist-tag.html">npm-dist-tag(1)</a></code> for
37 details about tags.</p>
39 <li><p><code>[--access <public|restricted>]</code>
40 Tells the registry whether this package should be published as public or
41 restricted. Only applies to scoped packages, which default to <code>restricted</code>.
42 If you don't have a paid account, you must publish with <code>--access public</code>
43 to publish scoped packages.</p>
46 <p>Fails if the package name and version combination already exists in
47 the specified registry.</p>
48 <p>Once a package is published with a given name and version, that
49 specific name and version combination can never be used again, even if
50 it is removed with <a href="../cli/npm-unpublish.html">npm-unpublish(1)</a>.</p>
51 <h2 id="see-also">SEE ALSO</h2>
53 <li><a href="../misc/npm-registry.html">npm-registry(7)</a></li>
54 <li><a href="../misc/npm-scope.html">npm-scope(7)</a></li>
55 <li><a href="../cli/npm-adduser.html">npm-adduser(1)</a></li>
56 <li><a href="../cli/npm-owner.html">npm-owner(1)</a></li>
57 <li><a href="../cli/npm-deprecate.html">npm-deprecate(1)</a></li>
58 <li><a href="../cli/npm-tag.html">npm-tag(1)</a></li>
63 <table border=0 cellspacing=0 cellpadding=0 id=npmlogo>
64 <tr><td style="width:180px;height:10px;background:rgb(237,127,127)" colspan=18> </td></tr>
65 <tr><td rowspan=4 style="width:10px;height:10px;background:rgb(237,127,127)"> </td><td style="width:40px;height:10px;background:#fff" colspan=4> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=4> </td><td style="width:40px;height:10px;background:#fff" colspan=4> </td><td rowspan=4 style="width:10px;height:10px;background:rgb(237,127,127)"> </td><td colspan=6 style="width:60px;height:10px;background:#fff"> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=4> </td></tr>
66 <tr><td colspan=2 style="width:20px;height:30px;background:#fff" rowspan=3> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3> </td><td style="width:10px;height:10px;background:#fff" rowspan=3> </td><td style="width:20px;height:10px;background:#fff" rowspan=4 colspan=2> </td><td style="width:10px;height:20px;background:rgb(237,127,127)" rowspan=2> </td><td style="width:10px;height:10px;background:#fff" rowspan=3> </td><td style="width:20px;height:10px;background:#fff" rowspan=3 colspan=2> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3> </td><td style="width:10px;height:10px;background:#fff" rowspan=3> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3> </td></tr>
67 <tr><td style="width:10px;height:10px;background:#fff" rowspan=2> </td></tr>
68 <tr><td style="width:10px;height:10px;background:#fff"> </td></tr>
69 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
70 <tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
72 <p id="footer">npm-publish — npm@2.15.11</p>