Man page - npm-publish(1)
Packages contains this manual
- npm-root(1)
- npm-explain(1)
- npm-whoami(1)
- npm-pack(1)
- npm-bugs(1)
- npm-view(1)
- npm-outdated(1)
- npm-update(1)
- npm-query(1)
- npm-logout(1)
- npm-deprecate(1)
- npm-exec(1)
- npm-ping(1)
- npm-shrinkwrap-json(5)
- npm-help(1)
- npm-prefix(1)
- npm-diff(1)
- npm-owner(1)
- npm-install(1)
- npmrc(5)
- npm-uninstall(1)
- npm-hook(1)
- npm-unstar(1)
- npm-docs(1)
- pacote(1)
- npm-restart(1)
- npm-star(1)
- npm-link(1)
- npm-test(1)
- npm-token(1)
- npm-arborist(1)
- npm-profile(1)
- npm-team(1)
- npx(1)
- npm-stars(1)
- npm-adduser(1)
- npm-cache(1)
- npm-edit(1)
- npm-doctor(1)
- npm-help-search(1)
- arborist(1)
- npm-rebuild(1)
- npm-repo(1)
- npm-publish(1)
- npm-start(1)
- npm-unpublish(1)
- npm-dedupe(1)
- npm-init(1)
- npm-dist-tag(1)
- npm-login(1)
- npm-config(1)
- npm(1)
- npm-search(1)
- npm-version(1)
- npm-org(1)
- npm-shrinkwrap(1)
- npm-ls(1)
- package-json(5)
- npm-stop(1)
- npm-install-test(1)
- npm-completion(1)
- npm-run-script(1)
- npm-prune(1)
- npm-access(1)
- npm-ci(1)
- npm-audit(1)
- npm-find-dupes(1)
- npm-install-ci-test(1)
- package-lock-json(5)
- npm-fund(1)
- npm-explore(1)
- npm-pkg(1)
- node-pacote
- node-npmcli-mock-registry
- node-npmcli-node-gyp
- node-libnpmorg
- npm
- node-libnpmteam
- node-npmcli-promise-spawn
- node-libnpmdiff
- node-npmcli-run-script
- node-npmcli-metavuln-calculator
- node-npmcli-smoke-tests
- node-libnpmpublish
- node-qrcode-terminal
- node-npmcli-config
- node-npmcli-git
- node-libnpmaccess
- node-npm-packlist
- node-npmcli-disparity-colors
- node-libnpmexec
- node-npmcli-installed-package-contents
- node-libnpmpack
- node-npmcli-map-workspaces
- node-npmcli-query
- node-npmcli-arborist
- node-npmcli-package-json
- node-libnpmhook
- node-npmcli-name-from-folder
- node-libnpmversion
- node-libnpmfund
- node-libnpmsearch
apt-get install npm
Manual
NPM-PUBLISH
NAMESynopsis
Description
Files included in package
Configuration
See Also
NAME
npm-publish
Synopsis
<!-- AUTOGENERATED USAGE DESCRIPTIONS -->
Description
Publishes a package to the registry so that it can be installed by name.
By default npm
will publish to the public registry. This can be
overridden by specifying a different default registry or
using a
scope
in the name, combined with a
scope-configured registry (see
package.json
).
A
package
is interpreted the same way as other commands (like
npm install
and can be:
|
β’ |
a) a folder containing a program described by a |
package.json file
|
β’ |
b) a gzipped tarball containing (a) |
|||
|
β’ |
c) a url that resolves to (b) |
|||
|
β’ |
d) a <name>@<version> that is published on the registry (see |
registry ) with (c)
|
β’ |
e) a <name>@<tag> (see npm dist-tag ) that |
points to (d)
|
β’ |
f) a <name> that has a "latest" tag satisfying (e) |
|||
|
β’ |
g) a <git remote url> that resolves to (a) |
The publish will
fail if the package name and version combination already
exists in the specified registry.
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 unpublish
.
As of
npm@5
, 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.
Similar to
--dry-run
see
npm pack
, which figures
out the files to be included and packs them into a tarball
to be uploaded
to the registry.
Files included in package
To see what will
be included in your package, run
npx npm-packlist
.
All
files are included by default, with the following
exceptions:
|
β’ |
Certain files that are relevant to package installation and distribution |
are always included. For
example,
package.json
,
README.md
,
LICENSE
, and so on.
|
β’ |
If there is a "files" list in |
package.json
, 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.)
|
β’ |
If there is a .gitignore or .npmignore file, then ignored files in |
that and all child directories
will be excluded from the package. If
both
files exist, then the
.gitignore
is ignored,
and only the
.npmignore
is used.
.npmignore
files follow the same pattern
rules
as
.gitignore
files
|
β’ |
If the file matches certain patterns, then it will never be included, |
unless explicitly added to the
"files"
list in
package.json
, or
un-ignored with a
!
rule in a
.npmignore
or
.gitignore
file.
|
β’ |
Symbolic links are never included in npm packages. |
See
developers
for full details on whatβs
included in the published package, as well as details on how
the package is
built.
Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS -->
See Also
|
β’ |
package spec |
|||
|
β’ |
npm-packlist package |
|||
|
β’ |
npm registry |
|||
|
β’ |
npm scope |
|||
|
β’ |
npm adduser |
|||
|
β’ |
npm owner |
|||
|
β’ |
npm deprecate |
|||
|
β’ |
npm dist-tag |
|||
|
β’ |
npm pack |
|||
|
β’ |
npm profile |