deps: upgrade npm to 6.2.0

PR-URL: https://github.com/nodejs/node/pull/21592
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Kat Marchán 2018-07-18 13:55:52 -07:00 committed by Michaël Zasso
parent 2aca0957f4
commit 5842366ae8
No known key found for this signature in database
GPG Key ID: 770F7A9A5AE15600
1280 changed files with 26130 additions and 59616 deletions

View File

@ -1 +0,0 @@
* @npm/cli-team

View File

@ -1,70 +0,0 @@
#### I'm opening this issue because:
- [ ] npm is crashing.
- [ ] npm is producing an incorrect install.
- [ ] npm is doing something I don't understand.
- [ ] npm is producing incorrect or undesirable behavior.
- [ ] Other (_see below for feature requests_):
#### What's going wrong?
#### How can the CLI team reproduce the problem?
<!--
Please a complete description of how to reproduce the problem.
Include a gist of your npm-debug.log file.
If you've never used gist.github.com, start here:
https://github.com/EmmaRamirez/how-to-submit-your-npm-debug-log
-->
### supporting information:
- `npm -v` prints:
- `node -v` prints:
- `npm config get registry` prints:
- Windows, OS X/macOS, or Linux?:
- Network issues:
- Geographic location where npm was run:
- [ ] I use a proxy to connect to the npm registry.
- [ ] I use a proxy to connect to the web.
- [ ] I use a proxy when downloading Git repos.
- [ ] I access the npm registry via a VPN
- [ ] I don't use a proxy, but have limited or unreliable internet access.
- Container:
- [ ] I develop using Vagrant on Windows.
- [ ] I develop using Vagrant on OS X or Linux.
- [ ] I develop / deploy using Docker.
- [ ] I deploy to a PaaS (Triton, Heroku).
<!--
Thank you for contributing to npm! Please review this checklist
before submitting your issue.
- Please check if there's a solution in the troubleshooting wiki:
https://github.com/npm/npm/blob/latest/TROUBLESHOOTING.md
- Also ensure that your new issue conforms to npm's contribution guidelines:
https://github.com/npm/npm/blob/latest/CONTRIBUTING.md
- Participation in this open source project is subject to the npm Code of Conduct:
https://www.npmjs.com/policies/conduct
For feature requests, delete the above and uncomment the section following this one. But first, review the existing feature requests
and make sure there isn't one that already describes the feature
you'd like to see added:
https://github.com/npm/npm/issues?q=is%3Aopen+is%3Aissue+label%3Afeature-request+label%3Aalready-looked-at
-->
<!--
#### What's the feature?
#### What problem is the feature intended to solve?
#### Is the absence of this feature blocking you or your team? If so, how?
#### Is this feature similar to an existing feature in another tool?
#### Is this a feature you're prepared to implement, with support from the npm CLI team?
-->

1
deps/npm/.npmignore vendored
View File

@ -1,6 +1,7 @@
*.swp
.*.swp
npm-debug.log
/.github
/test
node_modules/marked
node_modules/ronn

14
deps/npm/AUTHORS vendored
View File

@ -570,3 +570,17 @@ Tieme van Veen <tiemevanveen@hotmail.com>
Finn Pauls <derfinn@gmail.com>
Jeremy Kahn <jeremyckahn@gmail.com>
Mertcan Mermerkaya <mertcan@mermerkaya.net>
Will Yardley <wyardley@users.noreply.github.com>
Matt Travi <github@travi.org>
Solomon Victorino <solomonvictorino@gmail.com>
Rich Trott <rtrott@gmail.com>
Maksym Kobieliev <maximaximums@gmail.com>
Thomas Reggi <socialtr@gmail.com>
David Gilbertson <gilbertson.david@gmail.com>
Rob Lourens <roblourens@gmail.com>
Karan Thakkar <karanjthakkar@gmail.com>
Howard T. Chiam <hchiam@users.noreply.github.com>
Geoffrey Mattie <info@geoffreymattie.com>
Luis Lobo Borobia <luislobo@gmail.com>
Aaron Tribou <tribou@users.noreply.github.com>
刘祺 <gucong@gmail.com>

218
deps/npm/CHANGELOG.md vendored
View File

@ -1,3 +1,221 @@
## v6.2.0 (2018-07-13):
In case you missed it, [we
moved!](https://blog.npmjs.org/post/175587538995/announcing-npmcommunity). We
look forward to seeing future PRs landing in
[npm/cli](https://github.com/npm/cli) in the future, and we'll be chatting with
you all in [npm.community](https://npm.community). Go check it out!
This final release of `npm@6.2.0` includes a couple of features that weren't
quite ready on time but that we'd still like to include. Enjoy!
### FEATURES
* [`244b18380`](https://github.com/npm/npm/commit/244b18380ee55950b13c293722771130dbad70de)
[#20554](https://github.com/npm/npm/pull/20554)
add support for --parseable output
([@luislobo](https://github.com/luislobo))
* [`7984206e2`](https://github.com/npm/npm/commit/7984206e2f41b8d8361229cde88d68f0c96ed0b8)
[#12697](https://github.com/npm/npm/pull/12697)
Add new `sign-git-commit` config to control whether the git commit itself gets
signed, or just the tag (which is the default).
([@tribou](https://github.com/tribou))
### FIXES
* [`4c32413a5`](https://github.com/npm/npm/commit/4c32413a5b42e18a34afb078cf00eed60f08e4ff)
[#19418](https://github.com/npm/npm/pull/19418)
Do not use `SET` to fetch the env in git-bash or Cygwin.
([@gucong3000](https://github.com/gucong3000))
### DEPENDENCY BUMPS
* [`d9b2712a6`](https://github.com/npm/npm/commit/d9b2712a670e5e78334e83f89a5ed49616f1f3d3)
`request@2.81.0`: Downgraded to allow better deduplication. This does
introduce a bunch of `hoek`-related audit reports, but they don't affect npm
itself so we consider it safe. We'll upgrade `request` again once `node-gyp`
unpins it.
([@simov](https://github.com/simov))
* [`2ac48f863`](https://github.com/npm/npm/commit/2ac48f863f90166b2bbf2021ed4cc04343d2503c)
`node-gyp@3.7.0`
([@MylesBorins](https://github.com/MylesBorins))
* [`8dc6d7640`](https://github.com/npm/npm/commit/8dc6d76408f83ba35bda77a2ac1bdbde01937349)
`cli-table3@0.5.0`: `cli-table2` is unmaintained and required `lodash`. With
this dependency bump, we've removed `lodash` from our tree, which cut back
tarball size by another 300kb.
([@Turbo87](https://github.com/Turbo87))
* [`90c759fee`](https://github.com/npm/npm/commit/90c759fee6055cf61cf6709432a5e6eae6278096)
`npm-audit-report@1.3.1`
([@zkat](https://github.com/zkat))
* [`4231a0a1e`](https://github.com/npm/npm/commit/4231a0a1eb2be13931c3b71eba38c0709644302c)
Add `cli-table3` to bundleDeps.
([@iarna](https://github.com/iarna))
* [`322d9c2f1`](https://github.com/npm/npm/commit/322d9c2f107fd82a4cbe2f9d7774cea5fbf41b8d)
Make `standard` happy.
([@iarna](https://github.com/iarna))
### DOCS
* [`5724983ea`](https://github.com/npm/npm/commit/5724983ea8f153fb122f9c0ccab6094a26dfc631)
[#21165](https://github.com/npm/npm/pull/21165)
Fix some markdown formatting in npm-disputes.md.
([@hchiam](https://github.com/hchiam))
* [`738178315`](https://github.com/npm/npm/commit/738178315fe48e463028657ea7ae541c3d63d171)
[#20920](https://github.com/npm/npm/pull/20920)
Explicitly state that republishing an unpublished package requires a 72h
waiting period.
([@gmattie](https://github.com/gmattie))
* [`f0a372b07`](https://github.com/npm/npm/commit/f0a372b074cc43ee0e1be28dbbcef0d556b3b36c)
Replace references to the old repo or issue tracker. We're at npm/cli now!
([@zkat](https://github.com/zkat))
## v6.2.0-next.1 (2018-07-05):
This is a quick patch to the release to fix an issue that was preventing users
from installing `npm@next`.
* [`ecdcbd745`](https://github.com/npm/npm/commit/ecdcbd745ae1edd9bdd102dc3845a7bc76e1c5fb)
[#21129](https://github.com/npm/npm/pull/21129)
Remove postinstall script that depended on source files, thus preventing
`npm@next` from being installable from the registry.
([@zkat](https://github.com/zkat))
## v6.2.0-next.0 (2018-06-28):
### NEW FEATURES
* [`ce0793358`](https://github.com/npm/npm/commit/ce07933588ec2da1cc1980f93bdaa485d6028ae2)
[#20750](https://github.com/npm/npm/pull/20750)
You can now disable the update notifier entirely by using
`--no-update-notifier` or setting it in your config with `npm config set
update-notifier false`.
([@travi](https://github.com/travi))
* [`d2ad776f6`](https://github.com/npm/npm/commit/d2ad776f6dcd92ae3937465736dcbca171131343)
[#20879](https://github.com/npm/npm/pull/20879)
When `npm run-script <script>` fails due to a typo or missing script, npm will
now do a "did you mean?..." for scripts that do exist.
([@watilde](https://github.com/watilde))
### BUGFIXES
* [`8f033d72d`](https://github.com/npm/npm/commit/8f033d72da3e84a9dbbabe3a768693817af99912)
[#20948](https://github.com/npm/npm/pull/20948)
Fix the regular expression matching in `xcode_emulation` in `node-gyp` to also
handle version numbers with multiple-digit major versions which would
otherwise break under use of XCode 10.
([@Trott](https://github.com/Trott))
* [`c8ba7573a`](https://github.com/npm/npm/commit/c8ba7573a4ea95789f674ce038762d6a77a8b047)
Stop trying to hoist/dedupe bundles dependencies.
([@iarna](https://github.com/iarna))
* [`cd698f068`](https://github.com/npm/npm/commit/cd698f06840b7c9407ac802efa96d16464722a7d)
[#20762](https://github.com/npm/npm/pull/20762)
Add synopsis to brief help for `npm audit` and suppress trailing newline.
([@wyardley](https://github.com/wyardley))
* [`6808ee3bd`](https://github.com/npm/npm/commit/6808ee3bd59560b1334a18aa6c6e0120094b03c0)
[#20881](https://github.com/npm/npm/pull/20881)
Exclude /.github directory from npm tarball.
([@styfle](https://github.com/styfle))
* [`177cbb476`](https://github.com/npm/npm/commit/177cbb4762c1402bfcbf0636c4bc4905fd684fc1)
[#21105](https://github.com/npm/npm/pull/21105)
Add suggestion to use a temporary cache instead of `npm cache clear --force`.
([@karanjthakkar](https://github.com/karanjthakkar))
### DOCS
* [`7ba3fca00`](https://github.com/npm/npm/commit/7ba3fca00554b884eb47f2ed661693faf2630b27)
[#20855](https://github.com/npm/npm/pull/20855)
Direct people to npm.community instead of the GitHub issue tracker on error.
([@zkat](https://github.com/zkat))
* [`88efbf6b0`](https://github.com/npm/npm/commit/88efbf6b0b403c5107556ff9e1bb7787a410d14d)
[#20859](https://github.com/npm/npm/pull/20859)
Fix typo in registry docs.
([@strugee](https://github.com/strugee))
* [`61bf827ae`](https://github.com/npm/npm/commit/61bf827aea6f98bba08a54e60137d4df637788f9)
[#20947](https://github.com/npm/npm/pull/20947)
Fixed a small grammar error in the README.
([@bitsol](https://github.com/bitsol))
* [`f5230c90a`](https://github.com/npm/npm/commit/f5230c90afef40f445bf148cbb16d6129a2dcc19)
[#21018](https://github.com/npm/npm/pull/21018)
Small typo fix in CONTRIBUTING.md.
([@reggi](https://github.com/reggi))
* [`833efe4b2`](https://github.com/npm/npm/commit/833efe4b2abcef58806f823d77ab8bb8f4f781c6)
[#20986](https://github.com/npm/npm/pull/20986)
Document current structure/expectations around package tarballs.
([@Maximaximum](https://github.com/Maximaximum))
* [`9fc0dc4f5`](https://github.com/npm/npm/commit/9fc0dc4f58d728bac6a8db7143d04863d7b653db)
[#21019](https://github.com/npm/npm/pull/21019)
Clarify behavior of `npm link ../path` shorthand.
([@davidgilbertson](https://github.com/davidgilbertson))
* [`3924c72d0`](https://github.com/npm/npm/commit/3924c72d06b9216ac2b6a9d951fd565a1d5eda89)
[#21064](https://github.com/npm/npm/pull/21064)
Add missing "if"
([@roblourens](https://github.com/roblourens))
### DEPENDENCY SHUFFLE!
We did some reshuffling and moving around of npm's own dependencies. This
significantly reduces the total bundle size of the npm pack, from 8MB to 4.8MB
for the distributed tarball! We also moved around what we actually commit to the
repo as far as devDeps go.
* [`0483f5c5d`](https://github.com/npm/npm/commit/0483f5c5deaf18c968a128657923103e49f4e67a)
Flatten and dedupe our dependencies!
([@iarna](https://github.com/iarna))
* [`ef9fa1ceb`](https://github.com/npm/npm/commit/ef9fa1ceb5f9d175fd453138b1a26d45a5071dfd)
Remove unused direct dependency `ansi-regex`.
([@iarna](https://github.com/iarna))
* [`0d14b0bc5`](https://github.com/npm/npm/commit/0d14b0bc59812f4e33798194e11ffacbea3c0493)
Reshuffle ansi-regex for better deduping.
([@iarna](https://github.com/iarna))
* [`68a101859`](https://github.com/npm/npm/commit/68a101859b2b6f78b2e7c3a936492acdb15f7c4a)
Reshuffle strip-ansi for better deduping.
([@iarna](https://github.com/iarna))
* [`0d5251f97`](https://github.com/npm/npm/commit/0d5251f97dc8b8b143064869e530d465c757ffbb)
Reshuffle is-fullwidth-code-point for better deduping.
([@iarna](https://github.com/iarna))
* [`2d0886632`](https://github.com/npm/npm/commit/2d08866327013522fc5fbe61ed872b8f30e92775)
Add fake-registry, npm-registry-mock replacement.
([@iarna](https://github.com/iarna))
### DEPENDENCIES
* [`8cff8eea7`](https://github.com/npm/npm/commit/8cff8eea75dc34c9c1897a7a6f65d7232bb0c64c)
`tar@4.4.3`
([@zkat](https://github.com/zkat))
* [`bfc4f873b`](https://github.com/npm/npm/commit/bfc4f873bd056b7e3aee389eda4ecd8a2e175923)
`pacote@8.1.6`
([@zkat](https://github.com/zkat))
* [`532096163`](https://github.com/npm/npm/commit/53209616329119be8fcc29db86a43cc8cf73454d)
`libcipm@2.0.0`
([@zkat](https://github.com/zkat))
* [`4a512771b`](https://github.com/npm/npm/commit/4a512771b67aa06505a0df002a9027c16a238c71)
`request@2.87.0`
([@iarna](https://github.com/iarna))
* [`b7cc48dee`](https://github.com/npm/npm/commit/b7cc48deee45da1feab49aa1dd4d92e33c9bcac8)
`which@1.3.1`
([@iarna](https://github.com/iarna))
* [`bae657c28`](https://github.com/npm/npm/commit/bae657c280f6ea8e677509a9576e1b47c65c5441)
`tar@4.4.4`
([@iarna](https://github.com/iarna))
* [`3d46e5c4e`](https://github.com/npm/npm/commit/3d46e5c4e3c5fecd9bf05a7425a16f2e8ad5c833)
`JSONStream@1.3.3`
([@iarna](https://github.com/iarna))
* [`d0a905daf`](https://github.com/npm/npm/commit/d0a905dafc7e3fcd304e8053acbe3da40ba22554)
`is-cidr@2.0.6`
([@iarna](https://github.com/iarna))
* [`4fc1f815f`](https://github.com/npm/npm/commit/4fc1f815fec5a7f6f057cf305e01d4126331d1f2)
`marked@0.4.0`
([@iarna](https://github.com/iarna))
* [`f72202944`](https://github.com/npm/npm/commit/f722029441a088d03df94bdfdeeec51cfd318659)
`tap@12.0.1`
([@iarna](https://github.com/iarna))
* [`bdce96eb3`](https://github.com/npm/npm/commit/bdce96eb3c30fcff873aa3f1190e8ae4928d690b)
`npm-profile@3.0.2`
([@iarna](https://github.com/iarna))
* [`fe4240e85`](https://github.com/npm/npm/commit/fe4240e852144770bf76d7b1952056ca5baa63cf)
`uuid@3.3.2`
([@zkat](https://github.com/zkat))
## v6.1.0 (2018-05-17):
### FIX WRITE AFTER END ERROR

View File

@ -6,7 +6,7 @@
* [Roles](#roles)
* [Community Members](#community-members)
* [Collaborators](#collaborators)
* [npm, Inc Employeees](#npm-inc-employees)
* [npm, Inc Employees](#npm-inc-employees)
## Introduction
@ -59,15 +59,15 @@ Collaborators who become inactive for 3 months or longer may have their collabor
* Only answer questions when they know the answer, and provide a reference to the answer.
* If collaborators aren't totally confident about their answer, please leave the issue and try another one.
* If they've responded to an issue, it becomes their responsibility to see it to resolution.
* Close issues if there's no response within a month.
* Defer to fellow Collaborators & npm employees for answers (Again, please don't @ collaborators or npm employees, thank you!)
* Make sure to search for [the troubleshooting doc](./TROUBLESHOOTING.md) and search on the issue tracker for similar issues before opening a new one.
* Make sure to search [the troubleshooting posts on npm.community](https://npm.community/c/support/troubleshooting) and search the rest of the forum for similar topics.
### npm, Inc Employees
Folks who work at npm, Inc, who have a responsibility to ensure the stability and functionality of the tools npm offers.
#### Abilities
* Label/triage new issues
* Respond to ongoing issues
* Close resolved issues

4
deps/npm/README.md vendored
View File

@ -7,7 +7,7 @@ npm(1) -- a JavaScript package manager
This is just enough info to get you up and running.
Much more info available via `npm help` once it's installed.
Much more info will be available via `npm help` once it's installed.
## IMPORTANT
@ -153,7 +153,7 @@ you should [read this](https://docs.npmjs.com/misc/developers).
When you find issues, please report them:
* web:
<https://github.com/npm/npm/issues>
<https://npm.community/c/bugs>
Be sure to include *all* of the output from the npm command that didn't work
as expected. The `npm-debug.log` file is also helpful to provide.

View File

@ -1,192 +0,0 @@
# Troubleshooting Common Issues
## Using this Document
Search for the error message you're getting and see if there's a match, or skim the [table of contents](#table-of-contents) below for topics that seem relevant to the issue you're having. Each issue section has steps to work around or fix the particular issue, and have examples of common error messages.
If you do not find the issue below, try searching the issue tracker itself for potential duplicates before opening a new issue.
If you're reading this document because you noticed an issue with npm's web site, please let the [web team](https://github.com/npm/www/issues) know.
### Updating this Document
If you think something should be added here, make a PR that includes the following:
0. a summary
0. one or more example errors
0. steps to debug and fix
0. links to at least one related issue from the tracker
For more details of the content and formatting of these entries, refer to examples below.
## Table of Contents
* [Upgrading npm](#upgrading-npm)
* [Proxies and Networking](#proxy-and-networking-issues)
* [Cannot find module](#cannot-find-module)
* [Shasum Check Fails](#shasum-check-fails)
* [No Git](#no-git)
## Upgrading npm
Whenever you get npm errors, it's a good idea to first check your npm version and upgrade to latest whenever possible. We still see people running npm@1 (!) and in those cases, installing the latest version of npm usually solves the problem.
You can check your npm version by running `npm -v`.
### Steps to Fix
* Upgrading on \*nix (OSX, Linux, etc.)
(You may need to prefix these commands with sudo, especially on Linux, or OS X if you installed Node using its default installer.)
You can upgrade to the latest version of npm using:
`npm install -g npm@latest`
Or upgrade to the most recent LTS release:
`npm install -g npm@lts`
* Upgrading on Windows
We have a [detailed guide](https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows) for upgrading on windows on our wiki.
## Proxy and Networking Issues
npm might not be able to connect to the registry for various reasons. Perhaps your machine is behind a firewall that needs to be opened, or you require a corporate proxy to access the npm registry. This issue can manifest in a wide number of different ways. Usually, strange network errors are an instance of this specific problem.
Sometimes, users may have install failures due to Git/Github access issues. Git/GitHub access is separate from npm registry access. For users in some locations (India in particular), problems installing packages may be due to connectivity problems reaching GitHub and not the npm registry.
If you believe your network is configured and working correctly, and you're still having problems installing, please let the [registry team](https://github.com/npm/registry/issues) know you're having trouble.
### Steps to Fix
0. Make sure you have a working internet connection. Can you reach https://registry.npmjs.org? Can you reach other sites? If other sites are unreachable, this is not a problem with npm.
0. Check http://status.npmjs.org/ for any potential current service outages.
0. If your company has a process for domain whitelisting for developers, make sure https://registry.npmjs.org is a whitelisted domain.
0. If you're in China, consider using https://npm.taobao.org/ as a registry, which sits behind the Firewall.
0. On Windows, npm does not access proxies configured at the system level, so you need to configure them manually in order for npm to access them. Make sure [you have added the appropriate proxy configuration to `.npmrc`](https://docs.npmjs.com/misc/config#https-proxy).
0. If you already have a proxy configured, it might be configured incorrectly or use the wrong credentials. Verify your credentials, test the specific credentials with a separate application.
0. The proxy itself, on the server, might also have a configuration error. In this case, you'll need to work with your system administrator to verify that the proxy, and HTTPS, are configured correctly. You may test it by running regular HTTPS requests.
### Example Errors
This error can manifest in a wide range of different ways:
```
npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! unable to verify the first certificate
```
```
npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY
npm ERR! unable to get local issuer certificate
```
```
npm ERR! code DEPTH_ZERO_SELF_SIGNED_CERT
npm ERR! self signed certificate
```
```
124 error code ECONNREFUSED
125 error errno ECONNREFUSED
126 error syscall connect
```
```
136 error Unexpected token <
136 error <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
136 error <HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
136 error <TITLE>ERROR: Cache Access Denied</TITLE>
```
```
31 verbose stack Error: connect ETIMEDOUT 123.123.123.123:443
```
```
108 error code EAI_AGAIN
109 error errno EAI_AGAIN
110 error syscall getaddrinfo
111 error getaddrinfo EAI_AGAIN proxy.yourcorp.com:811
```
```
npm ERR! Error: getaddrinfo ESRCH
npm ERR! at errnoException (dns.js:37:11)
npm ERR! at Object.onanswer as oncomplete
```
```
35 error Unexpected token u
35 error function FindProxyForURL(url, host) {
```
### Related issues
* [#14318](https://github.com/npm/npm/issues/14318)
* [#15059](https://github.com/npm/npm/issues/15059)
* [#14336](https://github.com/npm/npm/issues/14336)
## Cannot find module
If *when running npm* (not your application), you get an error about a module not being found, this almost certainly means that there's something wrong with your npm installation.
If this happens when trying to start your application, you might not have installed your package's dependencies yet.
### Steps to Fix
0. If this happens when you try to start your application, try running `npm install` to install the app's dependencies. Make sure all its actual dependencies are listed in `package.json`
0. If this happens on any npm command, please reinstall.
### Examples
```
module.js:338
throw err;
^
Error: Cannot find module
```
### Related Issues
* [#14699](https://github.com/npm/npm/issues/14699)
## Shasum Check Fails
This is a common issue which used to be caused by caching issues. Nowadays, the cache has been improved, so it's likely to be an install issue, which can be caused by network problems (sometimes even [proxy issues](#proxy-and-networking-issues)), a node bug, or possibly some sort of npm bug.
### Steps to Fix
0. Try running `npm install` again. It may have been a momentary hiccup or corruption during package download.
0. Check http://status.npmjs.org/ for any potential current service outages.
0. If the shasum error specifically has `Actual: da39a3ee5e6b4b0d3255bfef95601890afd80709`, with this exact shasum, it means the package download was empty, which is certainly a networking issue.
0. Make sure your [network connection and proxy settings](#proxy-and-networking-issues) are ok.
0. Update your node version to the latest stable version.
### Examples
```
npm ERR! shasum check failed for C:\Users\some-user\AppData\Local\Temp\npm-9356-7
d74e411\registry.npmjs.org\some-package\-\some-package-1.0.0.tgz
npm ERR! Expected: 652294c14651db29fa93bd2d5ff2983a4f08c636
npm ERR! Actual: c45474b40e6a7474633ec6f2b0315feaf15c61f2
npm ERR! From: https://registry.npmjs.org/some-package/-/some-package-1.0.0.tgz
```
### Related Issues
* [#14720](https://github.com/npm/npm/issues/14720)
* [#13405](https://github.com/npm/npm/issues/13405)
## No Git
If your install fails and you see a message saying you don't have git installed, it should be resolved by installing git.
### Steps to Fix
0. [Install git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) following the instructions for your machine.
### Examples
npm ERR! not found: git
ENOGIT
### Related Issues
* [#11095](https://github.com/npm/npm/issues/11095)

View File

@ -74,7 +74,10 @@
conf._exit = true
npm.load(conf, function (er) {
if (er) return errorHandler(er)
if (!unsupported.checkVersion(process.version).unsupported) {
if (
npm.config.get('update-notifier') &&
!unsupported.checkVersion(process.version).unsupported
) {
const pkg = require('../package.json')
let notifier = require('update-notifier')({pkg})
if (
@ -100,7 +103,7 @@
break
}
}
const changelog = `https://github.com/npm/npm/releases/tag/v${latest}`
const changelog = `https://github.com/npm/cli/releases/tag/v${latest}`
notifier.notify({
message: `New ${type} version of ${pkg.name} available! ${
useColor ? color.red(old) : old

View File

@ -3,7 +3,7 @@ npm-audit(1) -- Run a security audit
## SYNOPSIS
npm audit [--json]
npm audit [--json|--parseable]
npm audit fix [--force|--package-lock-only|--dry-run|--production|--only=dev]
## EXAMPLES
@ -48,6 +48,18 @@ Get the detailed audit report in JSON format:
$ npm audit --json
```
Get the detailed audit report in plain text result, separated by tab characters, allowing for
future reuse in scripting or command line post processing, like for example, selecting
some of the columns printed:
```
$ npm audit --parseable
```
To parse columns, you can use for example `awk`, and just print some of them:
```
$ npm audit --parseable | awk -F $'\t' '{print $1,$4}'
```
## DESCRIPTION
The audit command submits a description of the dependencies configured in

View File

@ -15,7 +15,7 @@ Add, remove, and enumerate distribution tags on a package:
* add:
Tags the specified version of the package with the specified tag, or the
`--tag` config if not specified. The tag you're adding is `latest` and you
`--tag` config if not specified. If the tag you're adding is `latest` and you
have two-factor authentication on auth-and-writes then you'll need to include
an otp on the command line with `--otp`.

View File

@ -69,8 +69,13 @@ after packing it up into a tarball (b).
Install a package that is sitting on the filesystem. Note: if you just want
to link a dev directory into your npm root, you can do this more easily by
using `npm link`. The filename *must* use `.tar`, `.tar.gz`, or `.tgz` as
using `npm link`.
Tarball requirements:
* The filename *must* use `.tar`, `.tar.gz`, or `.tgz` as
the extension.
* The package contents should reside in a subfolder inside the tarball (usually it is called `package/`). npm strips one directory layer when installing the package (an equivalent of `tar x --strip-components=1` is run).
* The package must contain a `package.json` file with `name` and `version` properties.
Example:
@ -218,11 +223,11 @@ after packing it up into a tarball (b).
Examples:
npm install git+ssh://git@github.com:npm/npm.git#v1.0.27
npm install git+ssh://git@github.com:npm/npm#semver:^5.0
npm install git+https://isaacs@github.com/npm/npm.git
npm install git://github.com/npm/npm.git#v1.0.27
GIT_SSH_COMMAND='ssh -i ~/.ssh/custom_ident' npm install git+ssh://git@github.com:npm/npm.git
npm install git+ssh://git@github.com:npm/cli.git#v1.0.27
npm install git+ssh://git@github.com:npm/cli#semver:^5.0
npm install git+https://isaacs@github.com/npm/cli.git
npm install git://github.com/npm/cli.git#v1.0.27
GIT_SSH_COMMAND='ssh -i ~/.ssh/custom_ident' npm install git+ssh://git@github.com:npm/cli.git
* `npm install <githubname>/<githubrepo>[#<commit-ish>]`:
* `npm install github:<githubname>/<githubrepo>[#<commit-ish>]`:

View File

@ -53,11 +53,14 @@ above use-case in a shorter way:
The second line is the equivalent of doing:
(cd ../node-redis; npm link)
npm link node-redis
npm link redis
That is, it first creates a global link, and then links the global
installation target into your project's `node_modules` folder.
Note that in this case, you are referring to the directory name, `node-redis`,
rather than the package name `redis`.
If your linked package is scoped (see `npm-scope(7)`) your link command must
include that scope, e.g.

View File

@ -28,9 +28,10 @@ version combination can never be reused. In order to publish the
package again, a new version number must be used.
With the default registry (`registry.npmjs.org`), unpublish is
only allowed with versions published in the last 24 hours. If you
are trying to unpublish a version published longer ago than that,
contact support@npmjs.com.
only allowed with versions published in the last 72 hours. Similarly,
new versions of unpublished packages may not be republished until 72 hours
have passed. If you are trying to unpublish a version published longer
ago than that, contact support@npmjs.com.
The scope is optional and follows the usual rules for `npm-scope(7)`.

View File

@ -53,10 +53,10 @@ See `npm-folders(5)` to learn about where npm puts stuff.
In particular, npm has two modes of operation:
* global mode:
* global mode:
npm installs packages into the install prefix at
`prefix/lib/node_modules` and bins are installed in `prefix/bin`.
* local mode:
* local mode:
npm installs packages into the current project directory, which
defaults to the current working directory. Packages are installed to
`./node_modules`, and bins are installed to `./node_modules/.bin`.
@ -90,24 +90,24 @@ following help topics:
npm is extremely configurable. It reads its configuration options from
5 places.
* Command line switches:
* Command line switches:
Set a config with `--key val`. All keys take a value, even if they
are booleans (the config parser doesn't know what the options are at
the time of parsing). If no value is provided, then the option is set
to boolean `true`.
* Environment Variables:
* Environment Variables:
Set any config by prefixing the name in an environment variable with
`npm_config_`. For example, `export npm_config_key=val`.
* User Configs:
* User Configs:
The file at $HOME/.npmrc is an ini-formatted list of configs. If
present, it is parsed. If the `userconfig` option is set in the cli
or env, then that will be used instead.
* Global Configs:
* Global Configs:
The file found at ../etc/npmrc (from the node executable, by default
this resolves to /usr/local/etc/npmrc) will be parsed if it is found.
If the `globalconfig` option is set in the cli, env, or user config,
then that file is parsed instead.
* Defaults:
* Defaults:
npm's default configuration options are defined in
lib/utils/config-defs.js. These must not be changed.
@ -117,34 +117,24 @@ See `npm-config(7)` for much much more information.
Patches welcome!
* code:
Read through `npm-coding-style(7)` if you plan to submit code.
You don't have to agree with it, but you do have to follow it.
* docs:
If you find an error in the documentation, edit the appropriate markdown
file in the "doc" folder. (Don't worry about generating the man page.)
Contributors are listed in npm's `package.json` file. You can view them
easily by doing `npm view npm contributors`.
If you would like to contribute, but don't know what to work on, read
the contributing guidelines and check the issues list.
* https://github.com/npm/npm/wiki/Contributing-Guidelines
* <https://github.com/npm/npm/issues>
* [CONTRIBUTING.md](https://github.com/npm/cli/blob/latest/CONTRIBUTING.md)
* [Bug tracker](https://npm.community/c/bugs)
* [Support tracker](https://npm.community/c/support)
## BUGS
When you find issues, please report them:
* web:
<https://github.com/npm/npm/issues>
<https://npm.community/c/bugs>
Be sure to include *all* of the output from the npm command that didn't work
as expected. The `npm-debug.log` file is also helpful to provide.
You can also look for isaacs in #node.js on irc://irc.freenode.net. He
will no doubt tell you to put the output in a gist or email.
Be sure to follow the template and bug reporting guidelines. You can also ask
for help in the [support forum](https://npm.community/c/support) if you're
unsure if it's actually a bug or are having trouble coming up with a detailed
reproduction to report.
## AUTHOR

View File

@ -368,7 +368,7 @@ Do it like this:
"repository" :
{ "type" : "git"
, "url" : "https://github.com/npm/npm.git"
, "url" : "https://github.com/npm/cli.git"
}
"repository" :
@ -490,10 +490,10 @@ specified, then `master` is used.
Examples:
git+ssh://git@github.com:npm/npm.git#v1.0.27
git+ssh://git@github.com:npm/npm#semver:^5.0
git+https://isaacs@github.com/npm/npm.git
git://github.com/npm/npm.git#v1.0.27
git+ssh://git@github.com:npm/cli.git#v1.0.27
git+ssh://git@github.com:npm/cli#semver:^5.0
git+https://isaacs@github.com/npm/cli.git
git://github.com/npm/cli.git#v1.0.27
### GitHub URLs

View File

@ -1034,6 +1034,17 @@ will also prevent _writing_ `npm-shrinkwrap.json` if `save` is true.
This option is an alias for `--package-lock`.
### sign-git-commit
* Default: false
* Type: Boolean
If set to true, then the `npm version` command will commit the new package
version using `-S` to add a signature.
Note that git requires you to have set up GPG keys in your git configs
for this to work properly.
### sign-git-tag
* Default: false
@ -1130,6 +1141,14 @@ Set to true to suppress the UID/GID switching when running package
scripts. If set explicitly to false, then installing as a non-root user
will fail.
### update-notifier
* Default: true
* Type: Boolean
Set to false to suppress the update notification when using an older
version of npm than the latest.
### usage
* Default: false

View File

@ -39,7 +39,7 @@ some other user wants to use that name. Here are some common ways that happens
really has to be updated. Alice works for Foo Inc, the makers of the
critically acclaimed and widely-marketed `foo` JavaScript toolkit framework.
They publish it to npm as `foojs`, but people are routinely confused when
`npm install `foo`` is some different thing.
`npm install foo` is some different thing.
4. Yusuf writes a parser for the widely-known `foo` file format, because he
needs it for work. Then, he gets a new job, and never updates the prototype.
Later on, Alice writes a much more complete `foo` parser, but can't publish,
@ -114,7 +114,7 @@ metadata.
## CHANGES
This is a living document and may be updated from time to time. Please refer to
the [git history for this document](https://github.com/npm/npm/commits/master/doc/misc/npm-disputes.md)
the [git history for this document](https://github.com/npm/cli/commits/latest/doc/misc/npm-disputes.md)
to view the changes.
## LICENSE

View File

@ -41,8 +41,8 @@ about your environment:
This is used to gather better metrics on how npm is used by humans, versus
build farms.
The npm registry does not to correlate the information in these headers with
any authenticated accounts that may be used in the same requests.
The npm registry does not try to correlate the information in these headers
with any authenticated accounts that may be used in the same requests.
## Can I run my own private registry?

View File

@ -13,7 +13,7 @@
<p><a href="https://travis-ci.org/npm/npm"><img src="https://img.shields.io/travis/npm/npm/latest.svg" alt="Build Status"></a></p>
<h2 id="synopsis">SYNOPSIS</h2>
<p>This is just enough info to get you up and running.</p>
<p>Much more info available via <code>npm help</code> once it&#39;s installed.</p>
<p>Much more info will be available via <code>npm help</code> once it&#39;s installed.</p>
<h2 id="important">IMPORTANT</h2>
<p><strong>You need node v6 or higher to run this program.</strong></p>
<p>To install an old <strong>and unsupported</strong> version of npm that works on node v5
@ -40,15 +40,12 @@ paths, etc.) then read on.</p>
<p>There&#39;s a pretty robust install script at
<a href="https://www.npmjs.com/install.sh">https://www.npmjs.com/install.sh</a>. You can download that and run it.</p>
<p>Here&#39;s an example using curl:</p>
<pre><code class="lang-sh">curl -L https://www.npmjs.com/install.sh | sh
</code></pre>
<pre><code class="language-sh">curl -L https://www.npmjs.com/install.sh | sh</code></pre>
<h3 id="slightly-fancier">Slightly Fancier</h3>
<p>You can set any npm configuration params with that script:</p>
<pre><code class="lang-sh">npm_config_prefix=/some/path sh install.sh
</code></pre>
<pre><code class="language-sh">npm_config_prefix=/some/path sh install.sh</code></pre>
<p>Or, you can run it in uber-debuggery mode:</p>
<pre><code class="lang-sh">npm_debug=1 sh install.sh
</code></pre>
<pre><code class="language-sh">npm_debug=1 sh install.sh</code></pre>
<h3 id="even-fancier">Even Fancier</h3>
<p>Get the code with git. Use <code>make</code> to build the docs and do other stuff.
If you plan on hacking on npm, <code>make link</code> is your friend.</p>
@ -69,11 +66,9 @@ git, and mess with it directly.</p>
<p>No.</p>
<h2 id="uninstalling">Uninstalling</h2>
<p>So sad to see you go.</p>
<pre><code class="lang-sh">sudo npm uninstall npm -g
</code></pre>
<pre><code class="language-sh">sudo npm uninstall npm -g</code></pre>
<p>Or, if that fails,</p>
<pre><code class="lang-sh">sudo make uninstall
</code></pre>
<pre><code class="language-sh">sudo make uninstall</code></pre>
<h2 id="more-severe-uninstalling">More Severe Uninstalling</h2>
<p>Usually, the above instructions are sufficient. That will remove
npm, but leave behind anything you&#39;ve installed.</p>
@ -82,13 +77,11 @@ then you can use the <code>npm ls</code> command to find them, and then <code>np
remove them.</p>
<p>To remove cruft left behind by npm 0.x, you can use the included
<code>clean-old.sh</code> script file. You can run it conveniently like this:</p>
<pre><code class="lang-sh">npm explore npm -g -- sh scripts/clean-old.sh
</code></pre>
<pre><code class="language-sh">npm explore npm -g -- sh scripts/clean-old.sh</code></pre>
<p>npm uses two configuration files, one for per-user configs, and another
for global (every-user) configs. You can view them by doing:</p>
<pre><code class="lang-sh">npm config get userconfig # defaults to ~/.npmrc
npm config get globalconfig # defaults to /usr/local/etc/npmrc
</code></pre>
<pre><code class="language-sh">npm config get userconfig # defaults to ~/.npmrc
npm config get globalconfig # defaults to /usr/local/etc/npmrc</code></pre>
<p>Uninstalling npm does not remove configuration files by default. You
must remove them yourself manually if you want them gone. Note that
this means that future npm installs will not remember the settings that
@ -102,7 +95,7 @@ you should <a href="https://docs.npmjs.com/misc/developers">read this</a>.</p>
<p>When you find issues, please report them:</p>
<ul>
<li>web:
<a href="https://github.com/npm/npm/issues">https://github.com/npm/npm/issues</a></li>
<a href="https://npm.community/c/bugs">https://npm.community/c/bugs</a></li>
</ul>
<p>Be sure to include <em>all</em> of the output from the npm command that didn&#39;t work
as expected. The <code>npm-debug.log</code> file is also helpful to provide.</p>
@ -127,5 +120,5 @@ doubt tell you to put the output in a gist or email.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer"><a href="../doc/README.html">README</a> &mdash; npm@6.1.0</p>
<p id="footer"><a href="../doc/README.html">README</a> &mdash; npm@6.2.0</p>

View File

@ -19,8 +19,7 @@ npm access revoke &lt;scope:team&gt; [&lt;package&gt;]
npm access ls-packages [&lt;user&gt;|&lt;scope&gt;|&lt;scope:team&gt;]
npm access ls-collaborators [&lt;package&gt; [&lt;user&gt;]]
npm access edit [&lt;package&gt;]
</code></pre><h2 id="description">DESCRIPTION</h2>
npm access edit [&lt;package&gt;]</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Used to set access controls on private packages.</p>
<p>For all of the subcommands, <code>npm access</code> will perform actions on the packages
in the current working directory if no package name is passed to the
@ -86,5 +85,5 @@ with an HTTP 402 status code (logically enough), unless you use
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-access &mdash; npm@6.1.0</p>
<p id="footer">npm-access &mdash; npm@6.2.0</p>

View File

@ -13,8 +13,7 @@
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm adduser [--registry=url] [--scope=@orgname] [--always-auth] [--auth-type=legacy]
aliases: login, add-user
</code></pre><h2 id="description">DESCRIPTION</h2>
aliases: login, add-user</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Create or verify a user named <code>&lt;username&gt;</code> in the specified registry, and
save the credentials to the <code>.npmrc</code> file. If no registry is specified,
the default registry will be used (see <code><a href="../misc/npm-config.html">npm-config(7)</a></code>).</p>
@ -37,16 +36,14 @@ to the scope of the project directory you&#39;re currently in, if any. See <code
<p>If specified, the user and login credentials given will be associated
with the specified scope. See <code><a href="../misc/npm-scope.html">npm-scope(7)</a></code>. You can use both at the same time,
e.g.</p>
<pre><code>npm adduser --registry=http://myregistry.example.com --scope=@myco
</code></pre><p>This will set a registry for the given scope and login or create a user for
<pre><code>npm adduser --registry=http://myregistry.example.com --scope=@myco</code></pre><p>This will set a registry for the given scope and login or create a user for
that registry at the same time.</p>
<h3 id="always-auth">always-auth</h3>
<p>Default: false</p>
<p>If specified, save configuration indicating that all requests to the given
registry should include authorization information. Useful for private
registries. Can be used with <code>--registry</code> and / or <code>--scope</code>, e.g.</p>
<pre><code>npm adduser --registry=http://private-registry.example.com --always-auth
</code></pre><p>This will ensure that all requests to that registry (including for tarballs)
<pre><code>npm adduser --registry=http://private-registry.example.com --always-auth</code></pre><p>This will ensure that all requests to that registry (including for tarballs)
include an authorization header. This setting may be necessary for use with
private registries where metadata and package tarballs are stored on hosts with
different hostnames. See <code>always-auth</code> in <code><a href="../misc/npm-config.html">npm-config(7)</a></code> for more details on
@ -81,5 +78,5 @@ username/password entry in legacy npm.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-adduser &mdash; npm@6.1.0</p>
<p id="footer">npm-adduser &mdash; npm@6.2.0</p>

View File

@ -11,29 +11,25 @@
<h1><a href="../cli/npm-audit.html">npm-audit</a></h1> <p>Run a security audit</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm audit [--json]
npm audit fix [--force|--package-lock-only|--dry-run|--production|--only=dev]
</code></pre><h2 id="examples">EXAMPLES</h2>
<pre><code>npm audit [--json|--parseable]
npm audit fix [--force|--package-lock-only|--dry-run|--production|--only=dev]</code></pre><h2 id="examples">EXAMPLES</h2>
<p>Scan your project for vulnerabilities and automatically install any compatible
updates to vulnerable dependencies:</p>
<pre><code>$ npm audit fix
</code></pre><p>Run <code>audit fix</code> without modifying <code>node_modules</code>, but still updating the
<pre><code>$ npm audit fix</code></pre><p>Run <code>audit fix</code> without modifying <code>node_modules</code>, but still updating the
pkglock:</p>
<pre><code>$ npm audit fix --package-lock-only
</code></pre><p>Skip updating <code>devDependencies</code>:</p>
<pre><code>$ npm audit fix --only=prod
</code></pre><p>Have <code>audit fix</code> install semver-major updates to toplevel dependencies, not just
<pre><code>$ npm audit fix --package-lock-only</code></pre><p>Skip updating <code>devDependencies</code>:</p>
<pre><code>$ npm audit fix --only=prod</code></pre><p>Have <code>audit fix</code> install semver-major updates to toplevel dependencies, not just
semver-compatible ones:</p>
<pre><code>$ npm audit fix --force
</code></pre><p>Do a dry run to get an idea of what <code>audit fix</code> will do, and <em>also</em> output
<pre><code>$ npm audit fix --force</code></pre><p>Do a dry run to get an idea of what <code>audit fix</code> will do, and <em>also</em> output
install information in JSON format:</p>
<pre><code>$ npm audit fix --dry-run --json
</code></pre><p>Scan your project for vulnerabilities and just show the details, without fixing
<pre><code>$ npm audit fix --dry-run --json</code></pre><p>Scan your project for vulnerabilities and just show the details, without fixing
anything:</p>
<pre><code>$ npm audit
</code></pre><p>Get the detailed audit report in JSON format:</p>
<pre><code>$ npm audit --json
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>$ npm audit</code></pre><p>Get the detailed audit report in JSON format:</p>
<pre><code>$ npm audit --json</code></pre><p>Get the detailed audit report in plain text result, separated by tab characters, allowing for
future reuse in scripting or command line post processing, like for example, selecting
some of the columns printed:</p>
<pre><code>$ npm audit --parseable</code></pre><p>To parse columns, you can use for example <code>awk</code>, and just print some of them:</p>
<pre><code>$ npm audit --parseable | awk -F $&#39;\t&#39; &#39;{print $1,$4}&#39;</code></pre><h2 id="description">DESCRIPTION</h2>
<p>The audit command submits a description of the dependencies configured in
your project to your default registry and asks for a report of known
vulnerabilities. The report returned includes instructions on how to act on
@ -85,4 +81,4 @@ different between runs.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-audit &mdash; npm@6.1.0</p>
<p id="footer">npm-audit &mdash; npm@6.2.0</p>

View File

@ -11,8 +11,7 @@
<h1><a href="../cli/npm-bin.html">npm-bin</a></h1> <p>Display npm bin folder</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm bin [-g|--global]
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>npm bin [-g|--global]</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Print the folder where npm will install executables.</p>
<h2 id="see-also">SEE ALSO</h2>
<ul>
@ -35,5 +34,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-bin &mdash; npm@6.1.0</p>
<p id="footer">npm-bin &mdash; npm@6.2.0</p>

View File

@ -13,8 +13,7 @@
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm bugs [&lt;pkgname&gt;]
aliases: issues
</code></pre><h2 id="description">DESCRIPTION</h2>
aliases: issues</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This command tries to guess at the likely location of a package&#39;s
bug tracker URL, and then tries to open it using the <code>--browser</code>
config param. If no package name is provided, it will search for
@ -55,5 +54,5 @@ a <code>package.json</code> in the current folder and use the <code>name</code>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-bugs &mdash; npm@6.1.0</p>
<p id="footer">npm-bugs &mdash; npm@6.2.0</p>

View File

@ -11,8 +11,7 @@
<h1><a href="../cli/npm-build.html">npm-build</a></h1> <p>Build a package</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm build [&lt;package-folder&gt;]
</code></pre><ul>
<pre><code>npm build [&lt;package-folder&gt;]</code></pre><ul>
<li><code>&lt;package-folder&gt;</code>:
A folder containing a <code>package.json</code> file in its root.</li>
</ul>
@ -20,8 +19,7 @@ A folder containing a <code>package.json</code> file in its root.</li>
<p>This is the plumbing command called by <code>npm link</code> and <code>npm install</code>.</p>
<p>It should generally be called during installation, but if you need to run it
directly, run:</p>
<pre><code>npm run-script build
</code></pre><h2 id="see-also">SEE ALSO</h2>
<pre><code>npm run-script build</code></pre><h2 id="see-also">SEE ALSO</h2>
<ul>
<li><a href="../cli/npm-install.html">npm-install(1)</a></li>
<li><a href="../cli/npm-link.html">npm-link(1)</a></li>
@ -40,5 +38,5 @@ directly, run:</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-build &mdash; npm@6.1.0</p>
<p id="footer">npm-build &mdash; npm@6.2.0</p>

View File

@ -31,5 +31,5 @@ install packages into the local space.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-bundle &mdash; npm@6.1.0</p>
<p id="footer">npm-bundle &mdash; npm@6.2.0</p>

View File

@ -19,8 +19,7 @@ npm cache add &lt;name&gt;@&lt;version&gt;
npm cache clean [&lt;path&gt;]
aliases: npm cache clear, npm cache rm
npm cache verify
</code></pre><h2 id="description">DESCRIPTION</h2>
npm cache verify</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Used to add, list, or clean the npm cache folder.</p>
<ul>
<li><p>add:
@ -89,5 +88,5 @@ verify</code>.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-cache &mdash; npm@6.1.0</p>
<p id="footer">npm-cache &mdash; npm@6.2.0</p>

View File

@ -11,25 +11,21 @@
<h1><a href="../cli/npm-ci.html">npm-ci</a></h1> <p>Install a project with a clean slate</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm ci
</code></pre><h2 id="example">EXAMPLE</h2>
<pre><code>npm ci</code></pre><h2 id="example">EXAMPLE</h2>
<p>Make sure you have a package-lock and an up-to-date install:</p>
<pre><code>$ cd ./my/npm/project
$ npm install
added 154 packages in 10s
$ ls | grep package-lock
</code></pre><p>Run <code>npm ci</code> in that project</p>
$ ls | grep package-lock</code></pre><p>Run <code>npm ci</code> in that project</p>
<pre><code>$ npm ci
added 154 packages in 5s
</code></pre><p>Configure Travis to build using <code>npm ci</code> instead of <code>npm install</code>:</p>
added 154 packages in 5s</code></pre><p>Configure Travis to build using <code>npm ci</code> instead of <code>npm install</code>:</p>
<pre><code># .travis.yml
install:
- npm ci
# keep the npm cache around to speed up installs
cache:
directories:
- &quot;$HOME/.npm&quot;
</code></pre><h2 id="description">DESCRIPTION</h2>
- &quot;$HOME/.npm&quot;</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This command is similar to <code><a href="../cli/npm-install.html">npm-install(1)</a></code>, except it&#39;s meant to be used in
automated environments such as test platforms, continuous integration, and
deployment. It can be significantly faster than a regular npm install by
@ -61,4 +57,4 @@ incrementally-installed local environments of most npm users.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-ci &mdash; npm@6.1.0</p>
<p id="footer">npm-ci &mdash; npm@6.2.0</p>

View File

@ -11,16 +11,14 @@
<h1><a href="../cli/npm-completion.html">npm-completion</a></h1> <p>Tab Completion for npm</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>source &lt;(npm completion)
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>source &lt;(npm completion)</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Enables tab-completion in all npm commands.</p>
<p>The synopsis above
loads the completions into your current shell. Adding it to
your ~/.bashrc or ~/.zshrc will make the completions available
everywhere:</p>
<pre><code>npm completion &gt;&gt; ~/.bashrc
npm completion &gt;&gt; ~/.zshrc
</code></pre><p>You may of course also pipe the output of npm completion to a file
npm completion &gt;&gt; ~/.zshrc</code></pre><p>You may of course also pipe the output of npm completion to a file
such as <code>/usr/local/etc/bash_completion.d/npm</code> if you have a system
that will read that file for you.</p>
<p>When <code>COMP_CWORD</code>, <code>COMP_LINE</code>, and <code>COMP_POINT</code> are defined in the
@ -43,5 +41,5 @@ completions based on the arguments.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-completion &mdash; npm@6.1.0</p>
<p id="footer">npm-completion &mdash; npm@6.2.0</p>

View File

@ -19,8 +19,7 @@ npm config edit
npm get &lt;key&gt;
npm set &lt;key&gt; &lt;value&gt; [-g|--global]
aliases: c
</code></pre><h2 id="description">DESCRIPTION</h2>
aliases: c</code></pre><h2 id="description">DESCRIPTION</h2>
<p>npm gets its config settings from the command line, environment
variables, <code>npmrc</code> files, and in some cases, the <code>package.json</code> file.</p>
<p>See <a href="../files/npmrc.html">npmrc(5)</a> for more information about the npmrc files.</p>
@ -31,22 +30,17 @@ of the user and global npmrc files.</p>
<h2 id="sub-commands">Sub-commands</h2>
<p>Config supports the following sub-commands:</p>
<h3 id="set">set</h3>
<pre><code>npm config set key value
</code></pre><p>Sets the config key to the value.</p>
<pre><code>npm config set key value</code></pre><p>Sets the config key to the value.</p>
<p>If value is omitted, then it sets it to &quot;true&quot;.</p>
<h3 id="get">get</h3>
<pre><code>npm config get key
</code></pre><p>Echo the config value to stdout.</p>
<pre><code>npm config get key</code></pre><p>Echo the config value to stdout.</p>
<h3 id="list">list</h3>
<pre><code>npm config list
</code></pre><p>Show all the config settings. Use <code>-l</code> to also show defaults. Use <code>--json</code>
<pre><code>npm config list</code></pre><p>Show all the config settings. Use <code>-l</code> to also show defaults. Use <code>--json</code>
to show the settings in json format.</p>
<h3 id="delete">delete</h3>
<pre><code>npm config delete key
</code></pre><p>Deletes the key from all configuration files.</p>
<pre><code>npm config delete key</code></pre><p>Deletes the key from all configuration files.</p>
<h3 id="edit">edit</h3>
<pre><code>npm config edit
</code></pre><p>Opens the config file in an editor. Use the <code>--global</code> flag to edit the
<pre><code>npm config edit</code></pre><p>Opens the config file in an editor. Use the <code>--global</code> flag to edit the
global config.</p>
<h2 id="see-also">SEE ALSO</h2>
<ul>
@ -68,5 +62,5 @@ global config.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-config &mdash; npm@6.1.0</p>
<p id="footer">npm-config &mdash; npm@6.2.0</p>

View File

@ -14,8 +14,7 @@
<pre><code>npm dedupe
npm ddp
aliases: find-dupes, ddp
</code></pre><h2 id="description">DESCRIPTION</h2>
aliases: find-dupes, ddp</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Searches the local package tree and attempts to simplify the overall
structure by moving dependencies further up the tree, where they can
be more effectively shared by multiple dependent packages.</p>
@ -24,13 +23,11 @@ be more effectively shared by multiple dependent packages.</p>
+-- b &lt;-- depends on c@1.0.x
| `-- c@1.0.3
`-- d &lt;-- depends on c@~1.0.9
`-- c@1.0.10
</code></pre><p>In this case, <code><a href="../cli/npm-dedupe.html">npm-dedupe(1)</a></code> will transform the tree to:</p>
`-- c@1.0.10</code></pre><p>In this case, <code><a href="../cli/npm-dedupe.html">npm-dedupe(1)</a></code> will transform the tree to:</p>
<pre><code>a
+-- b
+-- d
`-- c@1.0.10
</code></pre><p>Because of the hierarchical nature of node&#39;s module lookup, b and d
`-- c@1.0.10</code></pre><p>Because of the hierarchical nature of node&#39;s module lookup, b and d
will both get their dependency met by the single c package at the root
level of the tree.</p>
<p>The deduplication algorithm walks the tree, moving each dependency as far
@ -61,5 +58,5 @@ result in new modules being installed.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-dedupe &mdash; npm@6.1.0</p>
<p id="footer">npm-dedupe &mdash; npm@6.2.0</p>

View File

@ -11,14 +11,12 @@
<h1><a href="../cli/npm-deprecate.html">npm-deprecate</a></h1> <p>Deprecate a version of a package</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm deprecate &lt;pkg&gt;[@&lt;version&gt;] &lt;message&gt;
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>npm deprecate &lt;pkg&gt;[@&lt;version&gt;] &lt;message&gt;</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This command will update the npm registry entry for a package, providing
a deprecation warning to all who attempt to install it.</p>
<p>It works on version ranges as well as specific versions, so you can do
something like this:</p>
<pre><code>npm deprecate my-thing@&quot;&lt; 0.2.3&quot; &quot;critical bug fixed in v0.2.3&quot;
</code></pre><p>Note that you must be the package owner to deprecate something. See the
<pre><code>npm deprecate my-thing@&quot;&lt; 0.2.3&quot; &quot;critical bug fixed in v0.2.3&quot;</code></pre><p>Note that you must be the package owner to deprecate something. See the
<code>owner</code> and <code>adduser</code> help topics.</p>
<p>To un-deprecate a package, specify an empty string (<code>&quot;&quot;</code>) for the <code>message</code> argument.</p>
<h2 id="see-also">SEE ALSO</h2>
@ -38,5 +36,5 @@ something like this:</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-deprecate &mdash; npm@6.1.0</p>
<p id="footer">npm-deprecate &mdash; npm@6.2.0</p>

View File

@ -15,13 +15,12 @@
npm dist-tag rm &lt;pkg&gt; &lt;tag&gt;
npm dist-tag ls [&lt;pkg&gt;]
aliases: dist-tags
</code></pre><h2 id="description">DESCRIPTION</h2>
aliases: dist-tags</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Add, remove, and enumerate distribution tags on a package:</p>
<ul>
<li><p>add:
Tags the specified version of the package with the specified tag, or the
<code>--tag</code> config if not specified. The tag you&#39;re adding is <code>latest</code> and you
<code>--tag</code> config if not specified. If the tag you&#39;re adding is <code>latest</code> and you
have two-factor authentication on auth-and-writes then you&#39;ll need to include
an otp on the command line with <code>--otp</code>.</p>
</li>
@ -35,10 +34,8 @@ the current prefix.</p>
</ul>
<p>A tag can be used when installing packages as a reference to a version instead
of using a specific version number:</p>
<pre><code>npm install &lt;name&gt;@&lt;tag&gt;
</code></pre><p>When installing dependencies, a preferred tagged version may be specified:</p>
<pre><code>npm install --tag &lt;tag&gt;
</code></pre><p>This also applies to <code>npm dedupe</code>.</p>
<pre><code>npm install &lt;name&gt;@&lt;tag&gt;</code></pre><p>When installing dependencies, a preferred tagged version may be specified:</p>
<pre><code>npm install --tag &lt;tag&gt;</code></pre><p>This also applies to <code>npm dedupe</code>.</p>
<p>Publishing a package sets the <code>latest</code> tag to the published version unless the
<code>--tag</code> option is used. For example, <code>npm publish --tag=beta</code>.</p>
<p>By default, <code>npm install &lt;pkg&gt;</code> (without any <code>@&lt;version&gt;</code> or <code>@&lt;tag&gt;</code>
@ -88,5 +85,5 @@ begin with a number or the letter <code>v</code>.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-dist-tag &mdash; npm@6.1.0</p>
<p id="footer">npm-dist-tag &mdash; npm@6.2.0</p>

View File

@ -14,8 +14,7 @@
<pre><code>npm docs [&lt;pkgname&gt; [&lt;pkgname&gt; ...]]
npm docs .
npm home [&lt;pkgname&gt; [&lt;pkgname&gt; ...]]
npm home .
</code></pre><h2 id="description">DESCRIPTION</h2>
npm home .</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This command tries to guess at the likely location of a package&#39;s
documentation URL, and then tries to open it using the <code>--browser</code>
config param. You can pass multiple package names at once. If no
@ -56,5 +55,5 @@ the current folder and use the <code>name</code> property.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-docs &mdash; npm@6.1.0</p>
<p id="footer">npm-docs &mdash; npm@6.2.0</p>

View File

@ -11,8 +11,7 @@
<h1><a href="../cli/npm-doctor.html">npm-doctor</a></h1> <p>Check your environments</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm doctor
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>npm doctor</code></pre><h2 id="description">DESCRIPTION</h2>
<p><code>npm doctor</code> runs a set of checks to ensure that your npm installation has
what it needs to manage your JavaScript packages. npm is mostly a standalone tool, but it does
have some basic requirements that must be met:</p>
@ -103,4 +102,4 @@ cache, you should probably run <code>npm cache clean</code> and reset the cache.
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-doctor &mdash; npm@6.1.0</p>
<p id="footer">npm-doctor &mdash; npm@6.2.0</p>

View File

@ -11,8 +11,7 @@
<h1><a href="../cli/npm-edit.html">npm-edit</a></h1> <p>Edit an installed package</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm edit &lt;pkg&gt;[@&lt;version&gt;]
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>npm edit &lt;pkg&gt;[@&lt;version&gt;]</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Opens the package folder in the default editor (or whatever you&#39;ve
configured as the npm <code>editor</code> config -- see <code><a href="../misc/npm-config.html">npm-config(7)</a></code>.)</p>
<p>After it has been edited, the package is rebuilt so as to pick up any
@ -49,5 +48,5 @@ or <code>&quot;notepad&quot;</code> on Windows.</li>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-edit &mdash; npm@6.1.0</p>
<p id="footer">npm-edit &mdash; npm@6.2.0</p>

View File

@ -11,15 +11,13 @@
<h1><a href="../cli/npm-explore.html">npm-explore</a></h1> <p>Browse an installed package</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm explore &lt;pkg&gt; [ -- &lt;command&gt;]
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>npm explore &lt;pkg&gt; [ -- &lt;command&gt;]</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Spawn a subshell in the directory of the installed package specified.</p>
<p>If a command is specified, then it is run in the subshell, which then
immediately terminates.</p>
<p>This is particularly handy in the case of git submodules in the
<code>node_modules</code> folder:</p>
<pre><code>npm explore some-dependency -- git pull origin master
</code></pre><p>Note that the package is <em>not</em> automatically rebuilt afterwards, so be
<pre><code>npm explore some-dependency -- git pull origin master</code></pre><p>Note that the package is <em>not</em> automatically rebuilt afterwards, so be
sure to use <code>npm rebuild &lt;pkg&gt;</code> if you make any changes.</p>
<h2 id="configuration">CONFIGURATION</h2>
<h3 id="shell">shell</h3>
@ -49,5 +47,5 @@ Windows</li>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-explore &mdash; npm@6.1.0</p>
<p id="footer">npm-explore &mdash; npm@6.2.0</p>

View File

@ -11,8 +11,7 @@
<h1><a href="../cli/npm-help-search.html">npm-help-search</a></h1> <p>Search npm help documentation</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm help-search &lt;text&gt;
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>npm help-search &lt;text&gt;</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This command will search the npm markdown documentation files for the
terms provided, and then list the results, sorted by relevance.</p>
<p>If only one result is found, then it will show that help topic.</p>
@ -45,5 +44,5 @@ where the terms were found in the documentation.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-help-search &mdash; npm@6.1.0</p>
<p id="footer">npm-help-search &mdash; npm@6.2.0</p>

View File

@ -11,8 +11,7 @@
<h1><a href="../cli/npm-help.html">npm-help</a></h1> <p>Get help on npm</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm help &lt;term&gt; [&lt;terms..&gt;]
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>npm help &lt;term&gt; [&lt;terms..&gt;]</code></pre><h2 id="description">DESCRIPTION</h2>
<p>If supplied a topic, then show the appropriate documentation page.</p>
<p>If the topic does not exist, or if multiple terms are provided, then run
the <code>help-search</code> command to find a match. Note that, if <code>help-search</code>
@ -50,5 +49,5 @@ matches are equivalent to specifying a topic name.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-help &mdash; npm@6.1.0</p>
<p id="footer">npm-help &mdash; npm@6.2.0</p>

View File

@ -14,23 +14,15 @@
<pre><code>npm hook ls [pkg]
npm hook add &lt;entity&gt; &lt;url&gt; &lt;secret&gt;
npm hook update &lt;id&gt; &lt;url&gt; [secret]
npm hook rm &lt;id&gt;
</code></pre><h2 id="example">EXAMPLE</h2>
npm hook rm &lt;id&gt;</code></pre><h2 id="example">EXAMPLE</h2>
<p>Add a hook to watch a package for changes:</p>
<pre><code>$ npm hook add lodash https://example.com/ my-shared-secret
</code></pre><p>Add a hook to watch packages belonging to the user <code>substack</code>:</p>
<pre><code>$ npm hook add ~substack https://example.com/ my-shared-secret
</code></pre><p>Add a hook to watch packages in the scope <code>@npm</code></p>
<pre><code>$ npm hook add @npm https://example.com/ my-shared-secret
</code></pre><p>List all your active hooks:</p>
<pre><code>$ npm hook ls
</code></pre><p>List your active hooks for the <code>lodash</code> package:</p>
<pre><code>$ npm hook ls lodash
</code></pre><p>Update an existing hook&#39;s url:</p>
<pre><code>$ npm hook update id-deadbeef https://my-new-website.here/
</code></pre><p>Remove a hook:</p>
<pre><code>$ npm hook rm id-deadbeef
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>$ npm hook add lodash https://example.com/ my-shared-secret</code></pre><p>Add a hook to watch packages belonging to the user <code>substack</code>:</p>
<pre><code>$ npm hook add ~substack https://example.com/ my-shared-secret</code></pre><p>Add a hook to watch packages in the scope <code>@npm</code></p>
<pre><code>$ npm hook add @npm https://example.com/ my-shared-secret</code></pre><p>List all your active hooks:</p>
<pre><code>$ npm hook ls</code></pre><p>List your active hooks for the <code>lodash</code> package:</p>
<pre><code>$ npm hook ls lodash</code></pre><p>Update an existing hook&#39;s url:</p>
<pre><code>$ npm hook update id-deadbeef https://my-new-website.here/</code></pre><p>Remove a hook:</p>
<pre><code>$ npm hook rm id-deadbeef</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Allows you to manage <a href="http://blog.npmjs.org/post/145260155635/introducing-hooks-get-notifications-of-npm">npm
hooks</a>,
including adding, removing, listing, and updating.</p>
@ -60,4 +52,4 @@ request came from your own configured hook.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-hook &mdash; npm@6.1.0</p>
<p id="footer">npm-hook &mdash; npm@6.2.0</p>

View File

@ -13,20 +13,15 @@
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm init [--force|-f|--yes|-y|--scope]
npm init &lt;@scope&gt; (same as `npx &lt;@scope&gt;/create`)
npm init [&lt;@scope&gt;/]&lt;name&gt; (same as `npx [&lt;@scope&gt;/]create-&lt;name&gt;`)
</code></pre><h2 id="examples">EXAMPLES</h2>
npm init [&lt;@scope&gt;/]&lt;name&gt; (same as `npx [&lt;@scope&gt;/]create-&lt;name&gt;`)</code></pre><h2 id="examples">EXAMPLES</h2>
<p>Create a new React-based project using <a href="https://npm.im/create-react-app"><code>create-react-app</code></a>:</p>
<pre><code>$ npm init react-app ./my-react-app
</code></pre><p>Create a new <code>esm</code>-compatible package using <a href="https://npm.im/create-esm"><code>create-esm</code></a>:</p>
<pre><code>$ npm init react-app ./my-react-app</code></pre><p>Create a new <code>esm</code>-compatible package using <a href="https://npm.im/create-esm"><code>create-esm</code></a>:</p>
<pre><code>$ mkdir my-esm-lib &amp;&amp; cd my-esm-lib
$ npm init esm --yes
</code></pre><p>Generate a plain old package.json using legacy init:</p>
$ npm init esm --yes</code></pre><p>Generate a plain old package.json using legacy init:</p>
<pre><code>$ mkdir my-npm-pkg &amp;&amp; cd my-npm-pkg
$ git init
$ npm init
</code></pre><p>Generate it without having it ask any questions:</p>
<pre><code>$ npm init -y
</code></pre><h2 id="description">DESCRIPTION</h2>
$ npm init</code></pre><p>Generate it without having it ask any questions:</p>
<pre><code>$ npm init -y</code></pre><h2 id="description">DESCRIPTION</h2>
<p><code>npm init &lt;initializer&gt;</code> can be used to set up a new or existing npm package.</p>
<p><code>initializer</code> in this case is an npm package named <code>create-&lt;initializer&gt;</code>, which
will be installed by <a href="https://npm.im/npx"><code><a href="../cli/npx.html">npx(1)</a></code></a>, and then have its main bin
@ -66,5 +61,5 @@ will create a scoped package.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-init &mdash; npm@6.1.0</p>
<p id="footer">npm-init &mdash; npm@6.2.0</p>

View File

@ -13,8 +13,7 @@
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm install-ci-test
alias: npm cit
</code></pre><h2 id="description">DESCRIPTION</h2>
alias: npm cit</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This command runs an <code>npm ci</code> followed immediately by an <code>npm test</code>.</p>
<h2 id="see-also">SEE ALSO</h2>
<ul>
@ -33,4 +32,4 @@ alias: npm cit
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-install-ci-test &mdash; npm@6.1.0</p>
<p id="footer">npm-install-ci-test &mdash; npm@6.2.0</p>

View File

@ -21,8 +21,7 @@ npm install-test &lt;tarball url&gt;
npm install-test &lt;folder&gt;
alias: npm it
common options: [--save|--save-dev|--save-optional] [--save-exact] [--dry-run]
</code></pre><h2 id="description">DESCRIPTION</h2>
common options: [--save|--save-dev|--save-optional] [--save-exact] [--dry-run]</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This command runs an <code>npm install</code> followed immediately by an <code>npm test</code>. It
takes exactly the same arguments as <code>npm install</code>.</p>
<h2 id="see-also">SEE ALSO</h2>
@ -42,5 +41,5 @@ takes exactly the same arguments as <code>npm install</code>.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-install-test &mdash; npm@6.1.0</p>
<p id="footer">npm-install-test &mdash; npm@6.2.0</p>

View File

@ -23,8 +23,7 @@ npm install &lt;tarball url&gt;
npm install &lt;folder&gt;
alias: npm i
common options: [-P|--save-prod|-D|--save-dev|-O|--save-optional] [-E|--save-exact] [-B|--save-bundle] [--no-save] [--dry-run]
</code></pre><h2 id="description">DESCRIPTION</h2>
common options: [-P|--save-prod|-D|--save-dev|-O|--save-optional] [-E|--save-exact] [-B|--save-bundle] [--no-save] [--dry-run]</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This command installs a package, and any packages that it depends on. If the
package has a package-lock or shrinkwrap file, the installation of dependencies
will be driven by that, with an <code>npm-shrinkwrap.json</code> taking precedence if both
@ -68,31 +67,34 @@ after packing it up into a tarball (b).</p>
<li><p><code>npm install &lt;tarball file&gt;</code>:</p>
<p> Install a package that is sitting on the filesystem. Note: if you just want
to link a dev directory into your npm root, you can do this more easily by
using <code>npm link</code>. The filename <em>must</em> use <code>.tar</code>, <code>.tar.gz</code>, or <code>.tgz</code> as
the extension.</p>
<p> Example:</p>
<pre><code> npm install ./package.tgz
</code></pre></li>
using <code>npm link</code>.</p>
<p> Tarball requirements:</p>
<ul>
<li>The filename <em>must</em> use <code>.tar</code>, <code>.tar.gz</code>, or <code>.tgz</code> as
the extension.</li>
<li>The package contents should reside in a subfolder inside the tarball (usually it is called <code>package/</code>). npm strips one directory layer when installing the package (an equivalent of <code>tar x --strip-components=1</code> is run).</li>
<li><p>The package must contain a <code>package.json</code> file with <code>name</code> and <code>version</code> properties.</p>
<p>Example:</p>
<pre><code>npm install ./package.tgz</code></pre></li>
</ul>
</li>
<li><p><code>npm install &lt;tarball url&gt;</code>:</p>
<p> Fetch the tarball url, and then install it. In order to distinguish between
this and other options, the argument must start with &quot;http://&quot; or &quot;https://&quot;</p>
<p> Example:</p>
<pre><code> npm install https://github.com/indexzero/forever/tarball/v0.5.6
</code></pre></li>
<pre><code> npm install https://github.com/indexzero/forever/tarball/v0.5.6</code></pre></li>
<li><p><code>npm install [&lt;@scope&gt;/]&lt;name&gt;</code>:</p>
<p> Do a <code>&lt;name&gt;@&lt;tag&gt;</code> install, where <code>&lt;tag&gt;</code> is the &quot;tag&quot; config. (See
<code><a href="../misc/npm-config.html">npm-config(7)</a></code>. The config&#39;s default value is <code>latest</code>.)</p>
<p> In most cases, this will install the version of the modules tagged as
<code>latest</code> on the npm registry.</p>
<p> Example:</p>
<pre><code> npm install sax
</code></pre><p> <code>npm install</code> saves any specified packages into <code>dependencies</code> by default.
<pre><code> npm install sax</code></pre><p> <code>npm install</code> saves any specified packages into <code>dependencies</code> by default.
Additionally, you can control where and how they get saved with some
additional flags:</p>
<ul>
<li><p><code>-P, --save-prod</code>: Package will appear in your <code>dependencies</code>. This is the</p>
<pre><code> default unless `-D` or `-O` are present.
</code></pre></li>
<pre><code> default unless `-D` or `-O` are present.</code></pre></li>
<li><p><code>-D, --save-dev</code>: Package will appear in your <code>devDependencies</code>.</p>
</li>
<li><p><code>-O, --save-optional</code>: Package will appear in your <code>optionalDependencies</code>.</p>
@ -121,30 +123,26 @@ npm install @myorg/privatepackage
npm install node-tap --save-dev
npm install dtrace-provider --save-optional
npm install readable-stream --save-exact
npm install ansi-regex --save-bundle
</code></pre></li>
npm install ansi-regex --save-bundle</code></pre></li>
</ul>
</li>
</ul>
<pre><code>**Note**: If there is a file or folder named `&lt;name&gt;` in the current
working directory, then it will try to install that, and only try to
fetch the package by name if it is not valid.
</code></pre><ul>
fetch the package by name if it is not valid.</code></pre><ul>
<li><p><code>npm install [&lt;@scope&gt;/]&lt;name&gt;@&lt;tag&gt;</code>:</p>
<p> Install the version of the package that is referenced by the specified tag.
If the tag does not exist in the registry data for that package, then this
will fail.</p>
<p> Example:</p>
<pre><code> npm install sax@latest
npm install @myorg/mypackage@latest
</code></pre></li>
npm install @myorg/mypackage@latest</code></pre></li>
<li><p><code>npm install [&lt;@scope&gt;/]&lt;name&gt;@&lt;version&gt;</code>:</p>
<p> Install the specified version of the package. This will fail if the
version has not been published to the registry.</p>
<p> Example:</p>
<pre><code> npm install sax@0.1.1
npm install @myorg/privatepackage@1.5.0
</code></pre></li>
npm install @myorg/privatepackage@1.5.0</code></pre></li>
<li><p><code>npm install [&lt;@scope&gt;/]&lt;name&gt;@&lt;version range&gt;</code>:</p>
<p> Install a version of the package matching the specified version range. This
will follow the same rules for resolving dependencies described in <code><a href="../files/package.json.html">package.json(5)</a></code>.</p>
@ -152,13 +150,11 @@ fetch the package by name if it is not valid.
treat it as a single argument.</p>
<p> Example:</p>
<pre><code> npm install sax@&quot;&gt;=0.1.0 &lt;0.2.0&quot;
npm install @myorg/privatepackage@&quot;&gt;=0.1.0 &lt;0.2.0&quot;
</code></pre></li>
npm install @myorg/privatepackage@&quot;&gt;=0.1.0 &lt;0.2.0&quot;</code></pre></li>
<li><p><code>npm install &lt;git remote url&gt;</code>:</p>
<p> Installs the package from the hosted git provider, cloning it with <code>git</code>.
For a full git remote url, only that URL will be attempted.</p>
<pre><code> &lt;protocol&gt;://[&lt;user&gt;[:&lt;password&gt;]@]&lt;hostname&gt;[:&lt;port&gt;][:][/]&lt;path&gt;[#&lt;commit-ish&gt; | #semver:&lt;semver&gt;]
</code></pre><p> <code>&lt;protocol&gt;</code> is one of <code>git</code>, <code>git+ssh</code>, <code>git+http</code>, <code>git+https</code>, or
<pre><code> &lt;protocol&gt;://[&lt;user&gt;[:&lt;password&gt;]@]&lt;hostname&gt;[:&lt;port&gt;][:][/]&lt;path&gt;[#&lt;commit-ish&gt; | #semver:&lt;semver&gt;]</code></pre><p> <code>&lt;protocol&gt;</code> is one of <code>git</code>, <code>git+ssh</code>, <code>git+http</code>, <code>git+https</code>, or
<code>git+file</code>.</p>
<p> If <code>#&lt;commit-ish&gt;</code> is provided, it will be used to clone exactly that
commit. If the commit-ish has the format <code>#semver:&lt;semver&gt;</code>, <code>&lt;semver&gt;</code> can
@ -183,12 +179,11 @@ fetch the package by name if it is not valid.
<li><p><code>GIT_SSL_NO_VERIFY</code></p>
<p>See the git man page for details.</p>
<p>Examples:</p>
<pre><code>npm install git+ssh://git@github.com:npm/npm.git#v1.0.27
npm install git+ssh://git@github.com:npm/npm#semver:^5.0
npm install git+https://isaacs@github.com/npm/npm.git
npm install git://github.com/npm/npm.git#v1.0.27
GIT_SSH_COMMAND=&#39;ssh -i ~/.ssh/custom_ident&#39; npm install git+ssh://git@github.com:npm/npm.git
</code></pre></li>
<pre><code>npm install git+ssh://git@github.com:npm/cli.git#v1.0.27
npm install git+ssh://git@github.com:npm/cli#semver:^5.0
npm install git+https://isaacs@github.com/npm/cli.git
npm install git://github.com/npm/cli.git#v1.0.27
GIT_SSH_COMMAND=&#39;ssh -i ~/.ssh/custom_ident&#39; npm install git+ssh://git@github.com:npm/cli.git</code></pre></li>
</ul>
</li>
<li><p><code>npm install &lt;githubname&gt;/&lt;githubrepo&gt;[#&lt;commit-ish&gt;]</code>:</p>
@ -207,8 +202,7 @@ GIT_SSH_COMMAND=&#39;ssh -i ~/.ssh/custom_ident&#39; npm install git+ssh://git@g
done installing.</p>
<p> Examples:</p>
<pre><code> npm install mygithubuser/myproject
npm install github:mygithubuser/myproject
</code></pre></li>
npm install github:mygithubuser/myproject</code></pre></li>
<li><p><code>npm install gist:[&lt;githubname&gt;/]&lt;gistID&gt;[#&lt;commit-ish&gt;|#semver:&lt;semver&gt;]</code>:</p>
<p> Install the package at <code>https://gist.github.com/gistID</code> by attempting to
clone it using <code>git</code>. The GitHub username associated with the gist is
@ -217,8 +211,7 @@ GIT_SSH_COMMAND=&#39;ssh -i ~/.ssh/custom_ident&#39; npm install git+ssh://git@g
be installed if the package has a <code>prepare</code> script, before the package is
done installing.</p>
<p> Example:</p>
<pre><code> npm install gist:101a11beef
</code></pre></li>
<pre><code> npm install gist:101a11beef</code></pre></li>
<li><p><code>npm install bitbucket:&lt;bitbucketname&gt;/&lt;bitbucketrepo&gt;[#&lt;commit-ish&gt;]</code>:</p>
<p> Install the package at <code>https://bitbucket.org/bitbucketname/bitbucketrepo</code>
by attempting to clone it using <code>git</code>.</p>
@ -232,8 +225,7 @@ GIT_SSH_COMMAND=&#39;ssh -i ~/.ssh/custom_ident&#39; npm install git+ssh://git@g
be installed if the package has a <code>prepare</code> script, before the package is
done installing.</p>
<p> Example:</p>
<pre><code> npm install bitbucket:mybitbucketuser/myproject
</code></pre></li>
<pre><code> npm install bitbucket:mybitbucketuser/myproject</code></pre></li>
<li><p><code>npm install gitlab:&lt;gitlabname&gt;/&lt;gitlabrepo&gt;[#&lt;commit-ish&gt;]</code>:</p>
<p> Install the package at <code>https://gitlab.com/gitlabname/gitlabrepo</code>
by attempting to clone it using <code>git</code>.</p>
@ -248,13 +240,11 @@ GIT_SSH_COMMAND=&#39;ssh -i ~/.ssh/custom_ident&#39; npm install git+ssh://git@g
done installing.</p>
<p> Example:</p>
<pre><code> npm install gitlab:mygitlabuser/myproject
npm install gitlab:myusr/myproj#semver:^5.0
</code></pre></li>
npm install gitlab:myusr/myproj#semver:^5.0</code></pre></li>
</ul>
<p>You may combine multiple arguments, and even multiple types of arguments.
For example:</p>
<pre><code>npm install sax@&quot;&gt;=0.1.0 &lt;0.2.0&quot; bench supervisor
</code></pre><p>The <code>--tag</code> argument will apply to all of the specified install targets. If a
<pre><code>npm install sax@&quot;&gt;=0.1.0 &lt;0.2.0&quot; bench supervisor</code></pre><p>The <code>--tag</code> argument will apply to all of the specified install targets. If a
tag with the given name exists, the tagged version is preferred over newer
versions.</p>
<p>The <code>--dry-run</code> argument will report in the usual way what the install would
@ -263,8 +253,7 @@ have done without actually installing anything.</p>
instead of checking <code>node_modules</code> and downloading dependencies.</p>
<p>The <code>-f</code> or <code>--force</code> argument will force npm to fetch remote resources even if a
local copy exists on disk.</p>
<pre><code>npm install sax --force
</code></pre><p>The <code>-g</code> or <code>--global</code> argument will cause npm to install the package globally
<pre><code>npm install sax --force</code></pre><p>The <code>-g</code> or <code>--global</code> argument will cause npm to install the package globally
rather than locally. See <code><a href="../files/npm-folders.html">npm-folders(5)</a></code>.</p>
<p>The <code>--global-style</code> argument will cause npm to install the package into
your local <code>node_modules</code> folder with the same layout it uses with the
@ -306,14 +295,12 @@ walk the clone and add any missing dependencies
compare the original tree with the cloned tree and make a list of
actions to take to convert one to the other
execute all of the actions, deepest first
kinds of actions are install, update, remove and move
</code></pre><p>For this <code>package{dep}</code> structure: <code>A{B,C}, B{C}, C{D}</code>,
kinds of actions are install, update, remove and move</code></pre><p>For this <code>package{dep}</code> structure: <code>A{B,C}, B{C}, C{D}</code>,
this algorithm produces:</p>
<pre><code>A
+-- B
+-- C
+-- D
</code></pre><p>That is, the dependency from B to C is satisfied by the fact that A
+-- D</code></pre><p>That is, the dependency from B to C is satisfied by the fact that A
already caused C to be installed at a higher level. D is still installed
at the top level because nothing conflicts with it.</p>
<p>For <code>A{B,C}, B{C,D@1}, C{D@2}</code>, this algorithm produces:</p>
@ -321,8 +308,7 @@ at the top level because nothing conflicts with it.</p>
+-- B
+-- C
`-- D@2
+-- D@1
</code></pre><p>Because B&#39;s D@1 will be installed in the top level, C now has to install D@2
+-- D@1</code></pre><p>Because B&#39;s D@1 will be installed in the top level, C now has to install D@2
privately for itself. This algorithm is deterministic, but different trees may
be produced if two dependencies are requested for installation in a different
order.</p>
@ -335,8 +321,7 @@ most cases can simply be addressed by changing the local package name.</p>
<p>There are some very rare and pathological edge-cases where a cycle can
cause npm to try to install a never-ending tree of packages. Here is
the simplest case:</p>
<pre><code>A -&gt; B -&gt; A&#39; -&gt; B&#39; -&gt; A -&gt; B -&gt; A&#39; -&gt; B&#39; -&gt; A -&gt; ...
</code></pre><p>where <code>A</code> is some version of a package, and <code>A&#39;</code> is a different version
<pre><code>A -&gt; B -&gt; A&#39; -&gt; B&#39; -&gt; A -&gt; B -&gt; A&#39; -&gt; B&#39; -&gt; A -&gt; ...</code></pre><p>where <code>A</code> is some version of a package, and <code>A&#39;</code> is a different version
of the same package. Because <code>B</code> depends on a different version of <code>A</code>
than the one that is already in the tree, it must install a separate
copy. The same is true of <code>A&#39;</code>, which must install <code>B&#39;</code>. Because <code>B&#39;</code>
@ -377,5 +362,5 @@ affects a real use-case, it will be investigated.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-install &mdash; npm@6.1.0</p>
<p id="footer">npm-install &mdash; npm@6.2.0</p>

View File

@ -14,8 +14,7 @@
<pre><code>npm link (in package dir)
npm link [&lt;@scope&gt;/]&lt;pkg&gt;[@&lt;version&gt;]
alias: npm ln
</code></pre><h2 id="description">DESCRIPTION</h2>
alias: npm ln</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Package linking is a two-step process.</p>
<p>First, <code>npm link</code> in a package folder will create a symlink in the global folder
<code>{prefix}/lib/node_modules/&lt;package&gt;</code> that links to the package where the <code>npm
@ -36,23 +35,21 @@ test it iteratively without having to continually rebuild.</p>
<pre><code>cd ~/projects/node-redis # go into the package directory
npm link # creates global link
cd ~/projects/node-bloggy # go into some other package directory.
npm link redis # link-install the package
</code></pre><p>Now, any changes to ~/projects/node-redis will be reflected in
npm link redis # link-install the package</code></pre><p>Now, any changes to ~/projects/node-redis will be reflected in
~/projects/node-bloggy/node_modules/node-redis/. Note that the link should
be to the package name, not the directory name for that package.</p>
<p>You may also shortcut the two steps in one. For example, to do the
above use-case in a shorter way:</p>
<pre><code>cd ~/projects/node-bloggy # go into the dir of your main project
npm link ../node-redis # link the dir of your dependency
</code></pre><p>The second line is the equivalent of doing:</p>
npm link ../node-redis # link the dir of your dependency</code></pre><p>The second line is the equivalent of doing:</p>
<pre><code>(cd ../node-redis; npm link)
npm link node-redis
</code></pre><p>That is, it first creates a global link, and then links the global
npm link redis</code></pre><p>That is, it first creates a global link, and then links the global
installation target into your project&#39;s <code>node_modules</code> folder.</p>
<p>Note that in this case, you are referring to the directory name, <code>node-redis</code>,
rather than the package name <code>redis</code>.</p>
<p>If your linked package is scoped (see <code><a href="../misc/npm-scope.html">npm-scope(7)</a></code>) your link command must
include that scope, e.g.</p>
<pre><code>npm link @myorg/privatepackage
</code></pre><h2 id="see-also">SEE ALSO</h2>
<pre><code>npm link @myorg/privatepackage</code></pre><h2 id="see-also">SEE ALSO</h2>
<ul>
<li><a href="../misc/npm-developers.html">npm-developers(7)</a></li>
<li><a href="../files/package.json.html">package.json(5)</a></li>
@ -74,5 +71,5 @@ include that scope, e.g.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-link &mdash; npm@6.1.0</p>
<p id="footer">npm-link &mdash; npm@6.2.0</p>

View File

@ -11,8 +11,7 @@
<h1><a href="../cli/npm-logout.html">npm-logout</a></h1> <p>Log out of the registry</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm logout [--registry=&lt;url&gt;] [--scope=&lt;@scope&gt;]
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>npm logout [--registry=&lt;url&gt;] [--scope=&lt;@scope&gt;]</code></pre><h2 id="description">DESCRIPTION</h2>
<p>When logged into a registry that supports token-based authentication, tell the
server to end this token&#39;s session. This will invalidate the token everywhere
you&#39;re using it, not just for the current environment.</p>
@ -29,8 +28,7 @@ it takes precedence.</p>
<h3 id="scope">scope</h3>
<p>Default: The scope of your current project, if any, otherwise none.</p>
<p>If specified, you will be logged out of the specified scope. See <code><a href="../misc/npm-scope.html">npm-scope(7)</a></code>.</p>
<pre><code>npm logout --scope=@myco
</code></pre><h2 id="see-also">SEE ALSO</h2>
<pre><code>npm logout --scope=@myco</code></pre><h2 id="see-also">SEE ALSO</h2>
<ul>
<li><a href="../cli/npm-adduser.html">npm-adduser(1)</a></li>
<li><a href="../misc/npm-registry.html">npm-registry(7)</a></li>
@ -51,5 +49,5 @@ it takes precedence.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-logout &mdash; npm@6.1.0</p>
<p id="footer">npm-logout &mdash; npm@6.2.0</p>

View File

@ -13,18 +13,16 @@
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm ls [[&lt;@scope&gt;/]&lt;pkg&gt; ...]
aliases: list, la, ll
</code></pre><h2 id="description">DESCRIPTION</h2>
aliases: list, la, ll</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This command will print to stdout all the versions of packages that are
installed, as well as their dependencies, in a tree-structure.</p>
<p>Positional arguments are <code>name@version-range</code> identifiers, which will
limit the results to only the paths to the packages named. Note that
nested packages will <em>also</em> show the paths to the specified packages.
For example, running <code>npm ls promzard</code> in npm&#39;s source tree will show:</p>
<pre><code>npm@6.1.0 /path/to/npm
<pre><code>npm@6.2.0 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre><p>It will print out extraneous, missing, and invalid packages.</p>
└── promzard@0.1.5</code></pre><p>It will print out extraneous, missing, and invalid packages.</p>
<p>If a project specifies git urls for dependencies these are shown
in parentheses after the name@version to make it easier for users to
recognize potential forks of a project.</p>
@ -110,5 +108,5 @@ project.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-ls &mdash; npm@6.1.0</p>
<p id="footer">npm-ls &mdash; npm@6.2.0</p>

View File

@ -11,8 +11,7 @@
<h1><a href="../cli/npm-outdated.html">npm-outdated</a></h1> <p>Check for outdated packages</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm outdated [[&lt;@scope&gt;/]&lt;pkg&gt; ...]
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>npm outdated [[&lt;@scope&gt;/]&lt;pkg&gt; ...]</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This command will check the registry to see if any (or, specific) installed
packages are currently outdated.</p>
<p>In the output:</p>
@ -42,15 +41,13 @@ glob 5.0.15 5.0.15 6.0.1 test-outdated-output
nothingness 0.0.3 git git test-outdated-output
npm 3.5.1 3.5.2 3.5.1 test-outdated-output
local-dev 0.0.3 linked linked test-outdated-output
once 1.3.2 1.3.3 1.3.3 test-outdated-output
</code></pre><p>With these <code>dependencies</code>:</p>
<pre><code class="lang-json">{
once 1.3.2 1.3.3 1.3.3 test-outdated-output</code></pre><p>With these <code>dependencies</code>:</p>
<pre><code class="language-json">{
&quot;glob&quot;: &quot;^5.0.15&quot;,
&quot;nothingness&quot;: &quot;github:othiym23/nothingness#master&quot;,
&quot;npm&quot;: &quot;^3.5.1&quot;,
&quot;once&quot;: &quot;^1.3.1&quot;
}
</code></pre>
}</code></pre>
<p>A few things to note:</p>
<ul>
<li><code>glob</code> requires <code>^5</code>, which prevents npm from installing <code>glob@6</code>, which is
@ -60,7 +57,7 @@ The installed committish might satisfy the dependency specifier (if it&#39;s
something immutable, like a commit SHA), or it might not, so <code>npm outdated</code> and
<code>npm update</code> have to fetch Git repos to check. This is why currently doing a
reinstall of a Git dependency always forces a new clone and install.</li>
<li><a href="mailto:`npm@3.5.2">`npm@3.5.2</a><code>is marked as &quot;wanted&quot;, but &quot;latest&quot; is</code><a href="mailto:npm@3.5.1">npm@3.5.1</a><code>because npm
<li><a href="mailto:%60npm@3.5.2">`npm@3.5.2</a><code>is marked as &quot;wanted&quot;, but &quot;latest&quot; is</code><a href="mailto:npm@3.5.1">npm@3.5.1</a><code>because npm
uses dist-tags to manage its</code>latest<code>and</code>next<code>release channels.</code>npm update<code>will install the _newest_ version, but</code>npm install npm<code>(with no semver range)
will install whatever&#39;s tagged as</code>latest`.</li>
<li><code>once</code> is just plain out of date. Reinstalling <code>node_modules</code> from scratch or
@ -117,5 +114,5 @@ project.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-outdated &mdash; npm@6.1.0</p>
<p id="footer">npm-outdated &mdash; npm@6.2.0</p>

View File

@ -15,8 +15,7 @@
npm owner rm &lt;user&gt; [&lt;@scope&gt;/]&lt;pkg&gt;
npm owner ls [&lt;@scope&gt;/]&lt;pkg&gt;
aliases: author
</code></pre><h2 id="description">DESCRIPTION</h2>
aliases: author</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Manage ownership of published packages.</p>
<ul>
<li>ls:
@ -54,5 +53,5 @@ with <code>--otp</code>.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-owner &mdash; npm@6.1.0</p>
<p id="footer">npm-owner &mdash; npm@6.2.0</p>

View File

@ -11,8 +11,7 @@
<h1><a href="../cli/npm-pack.html">npm-pack</a></h1> <p>Create a tarball from a package</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm pack [[&lt;@scope&gt;/]&lt;pkg&gt;...]
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>npm pack [[&lt;@scope&gt;/]&lt;pkg&gt;...]</code></pre><h2 id="description">DESCRIPTION</h2>
<p>For anything that&#39;s installable (that is, a package folder, tarball,
tarball url, name@tag, name@version, name, or scoped name), this
command will fetch it to the cache, and then copy the tarball to the
@ -41,5 +40,5 @@ overwritten the second time.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-pack &mdash; npm@6.1.0</p>
<p id="footer">npm-pack &mdash; npm@6.2.0</p>

View File

@ -11,14 +11,11 @@
<h1><a href="../cli/npm-ping.html">npm-ping</a></h1> <p>Ping npm registry</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm ping [--registry &lt;registry&gt;]
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>npm ping [--registry &lt;registry&gt;]</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Ping the configured or given npm registry and verify authentication.
If it works it will output something like:</p>
<pre><code>Ping success: {*Details about registry*}
</code></pre><p>otherwise you will get:</p>
<pre><code>Ping error: {*Detail about error}
</code></pre><h2 id="see-also">SEE ALSO</h2>
<pre><code>Ping success: {*Details about registry*}</code></pre><p>otherwise you will get:</p>
<pre><code>Ping error: {*Detail about error}</code></pre><h2 id="see-also">SEE ALSO</h2>
<ul>
<li><a href="../cli/npm-config.html">npm-config(1)</a></li>
<li><a href="../misc/npm-config.html">npm-config(7)</a></li>
@ -36,5 +33,5 @@ If it works it will output something like:</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-ping &mdash; npm@6.1.0</p>
<p id="footer">npm-ping &mdash; npm@6.2.0</p>

View File

@ -11,8 +11,7 @@
<h1><a href="../cli/npm-prefix.html">npm-prefix</a></h1> <p>Display prefix</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm prefix [-g]
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>npm prefix [-g]</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Print the local prefix to standard out. This is the closest parent directory
to contain a package.json file unless <code>-g</code> is also specified.</p>
<p>If <code>-g</code> is specified, this will be the value of the global prefix. See
@ -38,5 +37,5 @@ to contain a package.json file unless <code>-g</code> is also specified.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-prefix &mdash; npm@6.1.0</p>
<p id="footer">npm-prefix &mdash; npm@6.2.0</p>

View File

@ -15,8 +15,7 @@
npm profile set [--json|--parseable] &lt;property&gt; &lt;value&gt;
npm profile set password
npm profile enable-2fa [auth-and-writes|auth-only]
npm profile disable-2fa
</code></pre><h2 id="description">DESCRIPTION</h2>
npm profile disable-2fa</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Change your profile information on the registry. This not be available if
you&#39;re using a non-npmjs registry.</p>
<ul>
@ -44,8 +43,7 @@ properties. It looks like:</li>
| created | 2015-02-26T01:38:35.892Z |
+-----------------+---------------------------+
| updated | 2017-10-02T21:29:45.922Z |
+-----------------+---------------------------+
</code></pre><ul>
+-----------------+---------------------------+</code></pre><ul>
<li><p><code>npm profile set &lt;property&gt; &lt;value&gt;</code>:
Set the value of a profile property. You can set the following properties this way:
email, fullname, homepage, freenode, twitter, github</p>
@ -90,4 +88,4 @@ available on non npmjs.com registries.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-profile &mdash; npm@6.1.0</p>
<p id="footer">npm-profile &mdash; npm@6.2.0</p>

View File

@ -11,8 +11,7 @@
<h1><a href="../cli/npm-prune.html">npm-prune</a></h1> <p>Remove extraneous packages</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm prune [[&lt;@scope&gt;/]&lt;pkg&gt;...] [--production] [--dry-run] [--json]
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>npm prune [[&lt;@scope&gt;/]&lt;pkg&gt;...] [--production] [--dry-run] [--json]</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This command removes &quot;extraneous&quot; packages. If a package name is
provided, then only packages matching one of the supplied names are
removed.</p>
@ -48,5 +47,5 @@ and it&#39;s up to you to run <code>npm prune</code> from time-to-time to remove
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-prune &mdash; npm@6.1.0</p>
<p id="footer">npm-prune &mdash; npm@6.2.0</p>

View File

@ -14,8 +14,7 @@
<pre><code>npm publish [&lt;tarball&gt;|&lt;folder&gt;] [--tag &lt;tag&gt;] [--access &lt;public|restricted&gt;] [--otp otpcode]
Publishes &#39;.&#39; if no argument supplied
Sets tag &#39;latest&#39; if no --tag specified
</code></pre><h2 id="description">DESCRIPTION</h2>
Sets tag &#39;latest&#39; if no --tag specified</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Publishes a package to the registry so that it can be installed by name. All
files in the package directory are included if no local <code>.gitignore</code> or
<code>.npmignore</code> file exists. If both files exist and a file is ignored by
@ -85,5 +84,5 @@ packs them into a tarball to be uploaded to the registry.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-publish &mdash; npm@6.1.0</p>
<p id="footer">npm-publish &mdash; npm@6.2.0</p>

View File

@ -13,8 +13,7 @@
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm rebuild [[&lt;@scope&gt;/&lt;name&gt;]...]
alias: npm rb
</code></pre><h2 id="description">DESCRIPTION</h2>
alias: npm rb</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This command runs the <code>npm build</code> command on the matched folders. This is useful
when you install a new version of node, and must recompile all your C++ addons with
the new binary.</p>
@ -35,5 +34,5 @@ the new binary.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-rebuild &mdash; npm@6.1.0</p>
<p id="footer">npm-rebuild &mdash; npm@6.2.0</p>

View File

@ -11,8 +11,7 @@
<h1><a href="../cli/npm-repo.html">npm-repo</a></h1> <p>Open package repository page in the browser</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm repo [&lt;pkg&gt;]
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>npm repo [&lt;pkg&gt;]</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This command tries to guess at the likely location of a package&#39;s
repository URL, and then tries to open it using the <code>--browser</code>
config param. If no package name is provided, it will search for
@ -41,5 +40,5 @@ a <code>package.json</code> in the current folder and use the <code>name</code>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-repo &mdash; npm@6.1.0</p>
<p id="footer">npm-repo &mdash; npm@6.2.0</p>

View File

@ -11,8 +11,7 @@
<h1><a href="../cli/npm-restart.html">npm-restart</a></h1> <p>Restart a package</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm restart [-- &lt;args&gt;]
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>npm restart [-- &lt;args&gt;]</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This restarts a package.</p>
<p>This runs a package&#39;s &quot;stop&quot;, &quot;restart&quot;, and &quot;start&quot; scripts, and associated
pre- and post- scripts, in the order given below:</p>
@ -53,5 +52,5 @@ behavior will be accompanied by an increase in major version number</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-restart &mdash; npm@6.1.0</p>
<p id="footer">npm-restart &mdash; npm@6.2.0</p>

View File

@ -11,8 +11,7 @@
<h1><a href="../cli/npm-root.html">npm-root</a></h1> <p>Display npm root</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm root [-g]
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>npm root [-g]</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Print the effective <code>node_modules</code> folder to standard out.</p>
<h2 id="see-also">SEE ALSO</h2>
<ul>
@ -35,5 +34,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-root &mdash; npm@6.1.0</p>
<p id="footer">npm-root &mdash; npm@6.2.0</p>

View File

@ -13,8 +13,7 @@
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm run-script &lt;command&gt; [--silent] [-- &lt;args&gt;...]
alias: npm run
</code></pre><h2 id="description">DESCRIPTION</h2>
alias: npm run</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This runs an arbitrary command from a package&#39;s <code>&quot;scripts&quot;</code> object. If no
<code>&quot;command&quot;</code> is provided, it will list the available scripts. <code>run[-script]</code> is
used by the test, start, restart, and stop commands, but can be called
@ -24,8 +23,7 @@ separated into lifecycle (test, start, restart) and directly-run scripts.</p>
use custom arguments when executing scripts. The special option <code>--</code> is used by
<a href="http://goo.gl/KxMmtG">getopt</a> to delimit the end of the options. npm will pass
all the arguments after the <code>--</code> directly to your script:</p>
<pre><code>npm run test -- --grep=&quot;pattern&quot;
</code></pre><p>The arguments will only be passed to the script specified after <code>npm run</code>
<pre><code>npm run test -- --grep=&quot;pattern&quot;</code></pre><p>The arguments will only be passed to the script specified after <code>npm run</code>
and not to any pre or post script.</p>
<p>The <code>env</code> script is a special built-in command that can be used to list
environment variables that will be available to the script at runtime. If an
@ -36,10 +34,8 @@ built-in.</p>
locally-installed dependencies can be used without the <code>node_modules/.bin</code>
prefix. For example, if there is a <code>devDependency</code> on <code>tap</code> in your package,
you should write:</p>
<pre><code>&quot;scripts&quot;: {&quot;test&quot;: &quot;tap test/\*.js&quot;}
</code></pre><p>instead of</p>
<pre><code>&quot;scripts&quot;: {&quot;test&quot;: &quot;node_modules/.bin/tap test/\*.js&quot;}
</code></pre><p>to run your tests.</p>
<pre><code>&quot;scripts&quot;: {&quot;test&quot;: &quot;tap test/\*.js&quot;}</code></pre><p>instead of</p>
<pre><code>&quot;scripts&quot;: {&quot;test&quot;: &quot;node_modules/.bin/tap test/\*.js&quot;} </code></pre><p>to run your tests.</p>
<p>The actual shell your script is run within is platform dependent. By default,
on Unix-like systems it is the <code>/bin/sh</code> command, on Windows it is the <code>cmd.exe</code>.
The actual shell referred to by <code>/bin/sh</code> also depends on the system.
@ -83,5 +79,5 @@ without breaking the execution chain.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-run-script &mdash; npm@6.1.0</p>
<p id="footer">npm-run-script &mdash; npm@6.2.0</p>

View File

@ -13,8 +13,7 @@
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm search [-l|--long] [--json] [--parseable] [--no-description] [search terms ...]
aliases: s, se, find
</code></pre><h2 id="description">DESCRIPTION</h2>
aliases: s, se, find</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Search the registry for packages matching the search terms. <code>npm search</code>
performs a linear, incremental, lexically-ordered search through package
metadata for all files in the registry. If color is enabled, it will further
@ -109,5 +108,5 @@ setting.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-search &mdash; npm@6.1.0</p>
<p id="footer">npm-search &mdash; npm@6.2.0</p>

View File

@ -11,8 +11,7 @@
<h1><a href="../cli/npm-shrinkwrap.html">npm-shrinkwrap</a></h1> <p>Lock down dependency versions for publication</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm shrinkwrap
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>npm shrinkwrap</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This command repurposes <code>package-lock.json</code> into a publishable
<code>npm-shrinkwrap.json</code> or simply creates a new one. The file created and updated
by this command will then take precedence over any other existing or future
@ -41,5 +40,5 @@ of package locks in npm, see <a href="../files/npm-package-locks.html">npm-packa
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-shrinkwrap &mdash; npm@6.1.0</p>
<p id="footer">npm-shrinkwrap &mdash; npm@6.2.0</p>

View File

@ -12,8 +12,7 @@
<h1><a href="../cli/npm-star.html">npm-star</a></h1> <p>Mark your favorite packages</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm star [&lt;pkg&gt;...]
npm unstar [&lt;pkg&gt;...]
</code></pre><h2 id="description">DESCRIPTION</h2>
npm unstar [&lt;pkg&gt;...]</code></pre><h2 id="description">DESCRIPTION</h2>
<p>&quot;Starring&quot; a package means that you have some interest in it. It&#39;s
a vaguely positive way to show that you care.</p>
<p>&quot;Unstarring&quot; is the same thing, but in reverse.</p>
@ -36,5 +35,5 @@ a vaguely positive way to show that you care.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-star &mdash; npm@6.1.0</p>
<p id="footer">npm-star &mdash; npm@6.2.0</p>

View File

@ -11,8 +11,7 @@
<h1><a href="../cli/npm-stars.html">npm-stars</a></h1> <p>View packages marked as favorites</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm stars [&lt;user&gt;]
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>npm stars [&lt;user&gt;]</code></pre><h2 id="description">DESCRIPTION</h2>
<p>If you have starred a lot of neat things and want to find them again
quickly this command lets you do just that.</p>
<p>You may also want to see your friend&#39;s favorite packages, in this case
@ -36,5 +35,5 @@ you will most certainly enjoy this command.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-stars &mdash; npm@6.1.0</p>
<p id="footer">npm-stars &mdash; npm@6.2.0</p>

View File

@ -11,8 +11,7 @@
<h1><a href="../cli/npm-start.html">npm-start</a></h1> <p>Start a package</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm start [-- &lt;args&gt;]
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>npm start [-- &lt;args&gt;]</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This runs an arbitrary command specified in the package&#39;s <code>&quot;start&quot;</code> property of
its <code>&quot;scripts&quot;</code> object. If no <code>&quot;start&quot;</code> property is specified on the
<code>&quot;scripts&quot;</code> object, it will run <code>node server.js</code>.</p>
@ -39,5 +38,5 @@ more details.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-start &mdash; npm@6.1.0</p>
<p id="footer">npm-start &mdash; npm@6.2.0</p>

View File

@ -11,8 +11,7 @@
<h1><a href="../cli/npm-stop.html">npm-stop</a></h1> <p>Stop a package</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm stop [-- &lt;args&gt;]
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>npm stop [-- &lt;args&gt;]</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This runs a package&#39;s &quot;stop&quot; script, if one was provided.</p>
<h2 id="see-also">SEE ALSO</h2>
<ul>
@ -34,5 +33,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-stop &mdash; npm@6.1.0</p>
<p id="footer">npm-stop &mdash; npm@6.2.0</p>

View File

@ -19,8 +19,7 @@ npm team rm &lt;scope:team&gt; &lt;user&gt;
npm team ls &lt;scope&gt;|&lt;scope:team&gt;
npm team edit &lt;scope:team&gt;
</code></pre><h2 id="description">DESCRIPTION</h2>
npm team edit &lt;scope:team&gt;</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Used to manage teams in organizations, and change team memberships. Does not
handle permissions for packages.</p>
<p>Teams must always be fully qualified with the organization/scope they belong to
@ -70,5 +69,5 @@ use the <code>npm access</code> command to grant or revoke the appropriate permi
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-team &mdash; npm@6.1.0</p>
<p id="footer">npm-team &mdash; npm@6.2.0</p>

View File

@ -13,8 +13,7 @@
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code> npm test [-- &lt;args&gt;]
aliases: t, tst
</code></pre><h2 id="description">DESCRIPTION</h2>
aliases: t, tst</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This runs a package&#39;s &quot;test&quot; script, if one was provided.</p>
<h2 id="see-also">SEE ALSO</h2>
<ul>
@ -36,5 +35,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-test &mdash; npm@6.1.0</p>
<p id="footer">npm-test &mdash; npm@6.2.0</p>

View File

@ -13,8 +13,7 @@
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm token list [--json|--parseable]
npm token create [--read-only] [--cidr=1.1.1.1/24,2.2.2.2/16]
npm token revoke &lt;id|token&gt;
</code></pre><h2 id="description">DESCRIPTION</h2>
npm token revoke &lt;id|token&gt;</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This list you list, create and revoke authentication tokens.</p>
<ul>
<li><p><code>npm token list</code>:
@ -36,8 +35,7 @@ JSON with <code>--json</code> or tab-separated values with <code>--parseable</co
| 68c2fe | 127e51… | 2017-09-23 | no | |
+--------+---------+------------+----------+----------------+
| 6334e1 | 1dadd1… | 2017-09-23 | no | |
+--------+---------+------------+----------+----------------+
</code></pre></li>
+--------+---------+------------+----------+----------------+</code></pre></li>
<li><p><code>npm token create [--read-only] [--cidr=&lt;cidr-ranges&gt;]</code>:
Create a new authentication token. It can be <code>--read-only</code> or accept a list of
<a href="https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing">CIDR</a> ranges to
@ -53,8 +51,7 @@ two-factor authentication enabled, an otp.</p>
| readonly | false |
+----------------+--------------------------------------+
| created | 2017-10-02T07:52:24.838Z |
+----------------+--------------------------------------+
</code></pre><ul>
+----------------+--------------------------------------+</code></pre><ul>
<li><code>npm token revoke &lt;token|id&gt;</code>:
This removes an authentication token, making it immediately unusable. This can accept
both complete tokens (as you get back from <code>npm token create</code> and will
@ -73,4 +70,4 @@ This will NOT accept the truncated token found in <code>npm token list</code> ou
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-token &mdash; npm@6.1.0</p>
<p id="footer">npm-token &mdash; npm@6.2.0</p>

View File

@ -13,13 +13,11 @@
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm uninstall [&lt;@scope&gt;/]&lt;pkg&gt;[@&lt;version&gt;]... [-S|--save|-D|--save-dev|-O|--save-optional|--no-save]
aliases: remove, rm, r, un, unlink
</code></pre><h2 id="description">DESCRIPTION</h2>
aliases: remove, rm, r, un, unlink</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This uninstalls a package, completely removing everything npm installed
on its behalf.</p>
<p>Example:</p>
<pre><code>npm uninstall sax
</code></pre><p>In global mode (ie, with <code>-g</code> or <code>--global</code> appended to the command),
<pre><code>npm uninstall sax</code></pre><p>In global mode (ie, with <code>-g</code> or <code>--global</code> appended to the command),
it uninstalls the current package context as a global package.</p>
<p><code>npm uninstall</code> takes 3 exclusive, optional flags which save or update
the package version in your main package.json:</p>
@ -41,8 +39,7 @@ well.</p>
npm uninstall @myorg/privatepackage --save
npm uninstall node-tap --save-dev
npm uninstall dtrace-provider --save-optional
npm uninstall lodash --no-save
</code></pre><h2 id="see-also">SEE ALSO</h2>
npm uninstall lodash --no-save</code></pre><h2 id="see-also">SEE ALSO</h2>
<ul>
<li><a href="../cli/npm-prune.html">npm-prune(1)</a></li>
<li><a href="../cli/npm-install.html">npm-install(1)</a></li>
@ -63,5 +60,5 @@ npm uninstall lodash --no-save
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-uninstall &mdash; npm@6.1.0</p>
<p id="footer">npm-uninstall &mdash; npm@6.2.0</p>

View File

@ -11,8 +11,7 @@
<h1><a href="../cli/npm-unpublish.html">npm-unpublish</a></h1> <p>Remove a package from the registry</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm unpublish [&lt;@scope&gt;/]&lt;pkg&gt;[@&lt;version&gt;]
</code></pre><h2 id="warning">WARNING</h2>
<pre><code>npm unpublish [&lt;@scope&gt;/]&lt;pkg&gt;[@&lt;version&gt;]</code></pre><h2 id="warning">WARNING</h2>
<p><strong>It is generally considered bad behavior to remove versions of a library
that others are depending on!</strong></p>
<p>Consider using the <code>deprecate</code> command
@ -27,9 +26,10 @@ the root package entry is removed from the registry entirely.</p>
version combination can never be reused. In order to publish the
package again, a new version number must be used.</p>
<p>With the default registry (<code>registry.npmjs.org</code>), unpublish is
only allowed with versions published in the last 24 hours. If you
are trying to unpublish a version published longer ago than that,
contact <a href="mailto:support@npmjs.com">support@npmjs.com</a>.</p>
only allowed with versions published in the last 72 hours. Similarly,
new versions of unpublished packages may not be republished until 72 hours
have passed. If you are trying to unpublish a version published longer
ago than that, contact <a href="mailto:support@npmjs.com">support@npmjs.com</a>.</p>
<p>The scope is optional and follows the usual rules for <code><a href="../misc/npm-scope.html">npm-scope(7)</a></code>.</p>
<h2 id="see-also">SEE ALSO</h2>
<ul>
@ -51,5 +51,5 @@ contact <a href="mailto:support@npmjs.com">support@npmjs.com</a>.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-unpublish &mdash; npm@6.1.0</p>
<p id="footer">npm-unpublish &mdash; npm@6.2.0</p>

View File

@ -13,8 +13,7 @@
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm update [-g] [&lt;pkg&gt;...]
aliases: up, upgrade
</code></pre><h2 id="description">DESCRIPTION</h2>
aliases: up, upgrade</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This command will update all the packages listed to the latest version
(specified by the <code>tag</code> config), respecting semver.</p>
<p>It will also install missing packages. As with all commands that install
@ -24,14 +23,14 @@ as well.</p>
packages.</p>
<p>If no package name is specified, all packages in the specified location (global
or local) will be updated.</p>
<p>As of <a href="mailto:`npm@2.6.1">`npm@2.6.1</a><code>, the</code>npm update<code>will only inspect top-level packages.
<p>As of <a href="mailto:%60npm@2.6.1">`npm@2.6.1</a><code>, the</code>npm update<code>will only inspect top-level packages.
Prior versions of</code>npm<code>would also recursively inspect all dependencies.
To get the old behavior, use</code>npm --depth 9999 update`.</p>
<p>As of <a href="mailto:`npm@5.0.0">`npm@5.0.0</a><code>, the</code>npm update<code>will change</code>package.json<code>to save the
<p>As of <a href="mailto:%60npm@5.0.0">`npm@5.0.0</a><code>, the</code>npm update<code>will change</code>package.json<code>to save the
new version as the minimum required dependency. To get the old behavior,
use</code>npm update --no-save`.</p>
<h2 id="examples">EXAMPLES</h2>
<p>IMPORTANT VERSION NOTE: these examples assume <a href="mailto:`npm@2.6.1">`npm@2.6.1</a><code>or later. For
<p>IMPORTANT VERSION NOTE: these examples assume <a href="mailto:%60npm@2.6.1">`npm@2.6.1</a><code>or later. For
older versions of</code>npm<code>, you must specify</code>--depth 0` to get the behavior
described below.</p>
<p>For the examples below, assume that the current package is <code>app</code> and it depends
@ -49,33 +48,28 @@ on dependencies, <code>dep1</code> (<code>dep2</code>, .. etc.). The published
&quot;0.4.0&quot;,
&quot;0.2.0&quot;
]
}
</code></pre><h3 id="caret-dependencies">Caret Dependencies</h3>
}</code></pre><h3 id="caret-dependencies">Caret Dependencies</h3>
<p>If <code>app</code>&#39;s <code>package.json</code> contains:</p>
<pre><code>&quot;dependencies&quot;: {
&quot;dep1&quot;: &quot;^1.1.1&quot;
}
</code></pre><p>Then <code>npm update</code> will install <a href="mailto:`dep1@1.2.2">`dep1@1.2.2</a><code>, because</code>1.2.2<code>is</code>latest<code>and</code>1.2.2<code>satisfies</code>^1.1.1`.</p>
}</code></pre><p>Then <code>npm update</code> will install <a href="mailto:%60dep1@1.2.2">`dep1@1.2.2</a><code>, because</code>1.2.2<code>is</code>latest<code>and</code>1.2.2<code>satisfies</code>^1.1.1`.</p>
<h3 id="tilde-dependencies">Tilde Dependencies</h3>
<p>However, if <code>app</code>&#39;s <code>package.json</code> contains:</p>
<pre><code>&quot;dependencies&quot;: {
&quot;dep1&quot;: &quot;~1.1.1&quot;
}
</code></pre><p>In this case, running <code>npm update</code> will install <a href="mailto:`dep1@1.1.2">`dep1@1.1.2</a><code>. Even though the</code>latest<code>tag points to</code>1.2.2<code>, this version does not satisfy</code>~1.1.1<code>, which is equivalent
}</code></pre><p>In this case, running <code>npm update</code> will install <a href="mailto:%60dep1@1.1.2">`dep1@1.1.2</a><code>. Even though the</code>latest<code>tag points to</code>1.2.2<code>, this version does not satisfy</code>~1.1.1<code>, which is equivalent
to</code>&gt;=1.1.1 &lt;1.2.0<code>. So the highest-sorting version that satisfies</code>~1.1.1<code>is used,
which is</code>1.1.2`.</p>
<h3 id="caret-dependencies-below-1-0-0">Caret Dependencies below 1.0.0</h3>
<p>Suppose <code>app</code> has a caret dependency on a version below <code>1.0.0</code>, for example:</p>
<pre><code>&quot;dependencies&quot;: {
&quot;dep1&quot;: &quot;^0.2.0&quot;
}
</code></pre><p><code>npm update</code> will install <a href="mailto:`dep1@0.2.0">`dep1@0.2.0</a><code>, because there are no other
}</code></pre><p><code>npm update</code> will install <a href="mailto:%60dep1@0.2.0">`dep1@0.2.0</a><code>, because there are no other
versions which satisfy</code>^0.2.0`.</p>
<p>If the dependence were on <code>^0.4.0</code>:</p>
<pre><code>&quot;dependencies&quot;: {
&quot;dep1&quot;: &quot;^0.4.0&quot;
}
</code></pre><p>Then <code>npm update</code> will install <a href="mailto:`dep1@0.4.1">`dep1@0.4.1</a><code>, because that is the highest-sorting
}</code></pre><p>Then <code>npm update</code> will install <a href="mailto:%60dep1@0.4.1">`dep1@0.4.1</a><code>, because that is the highest-sorting
version that satisfies</code>^0.4.0<code>(</code>&gt;= 0.4.0 &lt;0.5.0`)</p>
<h3 id="updating-globally-installed-packages">Updating Globally-Installed Packages</h3>
<p><code>npm update -g</code> will apply the <code>update</code> action to each globally installed
@ -104,5 +98,5 @@ be <em>downgraded</em>.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-update &mdash; npm@6.1.0</p>
<p id="footer">npm-update &mdash; npm@6.2.0</p>

View File

@ -15,8 +15,7 @@
&#39;npm [-v | --version]&#39; to print npm version
&#39;npm view &lt;pkg&gt; version&#39; to view a package&#39;s published version
&#39;npm ls&#39; to inspect current package/dependency versions
</code></pre><h2 id="description">DESCRIPTION</h2>
&#39;npm ls&#39; to inspect current package/dependency versions</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Run this in a package directory to bump the version and write the new
data back to <code>package.json</code>, <code>package-lock.json</code>, and, if present, <code>npm-shrinkwrap.json</code>.</p>
<p>The <code>newversion</code> argument should be a valid semver string, a
@ -33,8 +32,7 @@ It will fail if the working directory is not clean, unless the <code>-f</code> o
use it as a commit message when creating a version commit. If the
<code>message</code> config contains <code>%s</code> then that will be replaced with the
resulting version number. For example:</p>
<pre><code>npm version patch -m &quot;Upgrade to %s for reasons&quot;
</code></pre><p>If the <code>sign-git-tag</code> config is set, then the tag will be signed using
<pre><code>npm version patch -m &quot;Upgrade to %s for reasons&quot;</code></pre><p>If the <code>sign-git-tag</code> config is set, then the tag will be signed using
the <code>-s</code> flag to git. Note that you must have a default GPG key set up
in your git config for this to work properly. For example:</p>
<pre><code>$ npm config set sign-git-tag true
@ -44,8 +42,7 @@ You need a passphrase to unlock the secret key for
user: &quot;isaacs (http://blog.izs.me/) &lt;i@izs.me&gt;&quot;
2048-bit RSA key, ID 6C481CF6, created 2010-08-31
Enter passphrase:
</code></pre><p>If <code>preversion</code>, <code>version</code>, or <code>postversion</code> are in the <code>scripts</code> property of
Enter passphrase:</code></pre><p>If <code>preversion</code>, <code>version</code>, or <code>postversion</code> are in the <code>scripts</code> property of
the package.json, they will be executed as part of running <code>npm version</code>.</p>
<p>The exact order of execution is as follows:</p>
<ol>
@ -68,8 +65,7 @@ the commit and/or tag.</li>
&quot;preversion&quot;: &quot;npm test&quot;,
&quot;version&quot;: &quot;npm run build &amp;&amp; git add -A dist&quot;,
&quot;postversion&quot;: &quot;git push &amp;&amp; git push --tags &amp;&amp; rm -rf build/temp&quot;
}
</code></pre><p>This runs all your tests, and proceeds only if they pass. Then runs your <code>build</code> script, and
}</code></pre><p>This runs all your tests, and proceeds only if they pass. Then runs your <code>build</code> script, and
adds everything in the <code>dist</code> directory to the commit. After the commit, it pushes the new commit
and tag up to the server, and deletes the <code>build/temp</code> directory.</p>
<h2 id="configuration">CONFIGURATION</h2>
@ -120,5 +116,5 @@ to the same value as the current version.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-version &mdash; npm@6.1.0</p>
<p id="footer">npm-version &mdash; npm@6.2.0</p>

View File

@ -13,50 +13,39 @@
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm view [&lt;@scope&gt;/]&lt;name&gt;[@&lt;version&gt;] [&lt;field&gt;[.&lt;subfield&gt;]...]
aliases: info, show, v
</code></pre><h2 id="description">DESCRIPTION</h2>
aliases: info, show, v</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This command shows data about a package and prints it to the stream
referenced by the <code>outfd</code> config, which defaults to stdout.</p>
<p>To show the package registry entry for the <code>connect</code> package, you can do
this:</p>
<pre><code>npm view connect
</code></pre><p>The default version is &quot;latest&quot; if unspecified.</p>
<pre><code>npm view connect</code></pre><p>The default version is &quot;latest&quot; if unspecified.</p>
<p>Field names can be specified after the package descriptor.
For example, to show the dependencies of the <code>ronn</code> package at version
0.3.5, you could do the following:</p>
<pre><code>npm view ronn@0.3.5 dependencies
</code></pre><p>You can view child fields by separating them with a period.
<pre><code>npm view ronn@0.3.5 dependencies</code></pre><p>You can view child fields by separating them with a period.
To view the git repository URL for the latest version of npm, you could
do this:</p>
<pre><code>npm view npm repository.url
</code></pre><p>This makes it easy to view information about a dependency with a bit of
<pre><code>npm view npm repository.url</code></pre><p>This makes it easy to view information about a dependency with a bit of
shell scripting. For example, to view all the data about the version of
opts that ronn depends on, you can do this:</p>
<pre><code>npm view opts@$(npm view ronn dependencies.opts)
</code></pre><p>For fields that are arrays, requesting a non-numeric field will return
<pre><code>npm view opts@$(npm view ronn dependencies.opts)</code></pre><p>For fields that are arrays, requesting a non-numeric field will return
all of the values from the objects in the list. For example, to get all
the contributor names for the &quot;express&quot; project, you can do this:</p>
<pre><code>npm view express contributors.email
</code></pre><p>You may also use numeric indices in square braces to specifically select
<pre><code>npm view express contributors.email</code></pre><p>You may also use numeric indices in square braces to specifically select
an item in an array field. To just get the email address of the first
contributor in the list, you can do this:</p>
<pre><code>npm view express contributors[0].email
</code></pre><p>Multiple fields may be specified, and will be printed one after another.
<pre><code>npm view express contributors[0].email</code></pre><p>Multiple fields may be specified, and will be printed one after another.
For example, to get all the contributor names and email addresses, you
can do this:</p>
<pre><code>npm view express contributors.name contributors.email
</code></pre><p>&quot;Person&quot; fields are shown as a string if they would be shown as an
<pre><code>npm view express contributors.name contributors.email</code></pre><p>&quot;Person&quot; fields are shown as a string if they would be shown as an
object. So, for example, this will show the list of npm contributors in
the shortened string format. (See <code><a href="../files/package.json.html">package.json(5)</a></code> for more on this.)</p>
<pre><code>npm view npm contributors
</code></pre><p>If a version range is provided, then data will be printed for every
<pre><code>npm view npm contributors</code></pre><p>If a version range is provided, then data will be printed for every
matching version of the package. This will show which version of jsdom
was required by each matching version of yui3:</p>
<pre><code>npm view yui3@&#39;&gt;0.5.4&#39; dependencies.jsdom
</code></pre><p>To show the <code>connect</code> package version history, you can do
<pre><code>npm view yui3@&#39;&gt;0.5.4&#39; dependencies.jsdom</code></pre><p>To show the <code>connect</code> package version history, you can do
this:</p>
<pre><code>npm view connect versions
</code></pre><h2 id="output">OUTPUT</h2>
<pre><code>npm view connect versions</code></pre><h2 id="output">OUTPUT</h2>
<p>If only a single string field for a single version is output, then it
will not be colorized or quoted, so as to enable piping the output to
another command. If the field is an object, it will be output as a JavaScript object literal.</p>
@ -86,5 +75,5 @@ the field name.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-view &mdash; npm@6.1.0</p>
<p id="footer">npm-view &mdash; npm@6.2.0</p>

View File

@ -11,8 +11,7 @@
<h1><a href="../cli/npm-whoami.html">npm-whoami</a></h1> <p>Display npm username</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm whoami [--registry &lt;registry&gt;]
</code></pre><h2 id="description">DESCRIPTION</h2>
<pre><code>npm whoami [--registry &lt;registry&gt;]</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Print the <code>username</code> config to standard output.</p>
<h2 id="see-also">SEE ALSO</h2>
<ul>
@ -33,5 +32,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-whoami &mdash; npm@6.1.0</p>
<p id="footer">npm-whoami &mdash; npm@6.2.0</p>

View File

@ -11,9 +11,8 @@
<h1><a href="../cli/npm.html">npm</a></h1> <p>javascript package manager</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm &lt;command&gt; [args]
</code></pre><h2 id="version">VERSION</h2>
<p>6.1.0</p>
<pre><code>npm &lt;command&gt; [args]</code></pre><h2 id="version">VERSION</h2>
<p>6.2.0</p>
<h2 id="description">DESCRIPTION</h2>
<p>npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
@ -45,9 +44,11 @@ the <a href="https://github.com/TooTallNate/node-gyp/wiki">node-gyp Wiki</a>.</p
<p>See <code><a href="../files/npm-folders.html">npm-folders(5)</a></code> to learn about where npm puts stuff.</p>
<p>In particular, npm has two modes of operation:</p>
<ul>
<li>global mode:<br>npm installs packages into the install prefix at
<li>global mode:
npm installs packages into the install prefix at
<code>prefix/lib/node_modules</code> and bins are installed in <code>prefix/bin</code>.</li>
<li>local mode:<br>npm installs packages into the current project directory, which
<li>local mode:
npm installs packages into the current project directory, which
defaults to the current working directory. Packages are installed to
<code>./node_modules</code>, and bins are installed to <code>./node_modules/.bin</code>.</li>
</ul>
@ -77,56 +78,52 @@ Use the <code>npm publish</code> command to upload your code to the registry.</l
<p>npm is extremely configurable. It reads its configuration options from
5 places.</p>
<ul>
<li>Command line switches:<br>Set a config with <code>--key val</code>. All keys take a value, even if they
<li>Command line switches:
Set a config with <code>--key val</code>. All keys take a value, even if they
are booleans (the config parser doesn&#39;t know what the options are at
the time of parsing). If no value is provided, then the option is set
to boolean <code>true</code>.</li>
<li>Environment Variables:<br>Set any config by prefixing the name in an environment variable with
<li>Environment Variables:
Set any config by prefixing the name in an environment variable with
<code>npm_config_</code>. For example, <code>export npm_config_key=val</code>.</li>
<li>User Configs:<br>The file at $HOME/.npmrc is an ini-formatted list of configs. If
<li>User Configs:
The file at $HOME/.npmrc is an ini-formatted list of configs. If
present, it is parsed. If the <code>userconfig</code> option is set in the cli
or env, then that will be used instead.</li>
<li>Global Configs:<br>The file found at ../etc/npmrc (from the node executable, by default
<li>Global Configs:
The file found at ../etc/npmrc (from the node executable, by default
this resolves to /usr/local/etc/npmrc) will be parsed if it is found.
If the <code>globalconfig</code> option is set in the cli, env, or user config,
then that file is parsed instead.</li>
<li>Defaults:<br>npm&#39;s default configuration options are defined in
<li>Defaults:
npm&#39;s default configuration options are defined in
lib/utils/config-defs.js. These must not be changed.</li>
</ul>
<p>See <code><a href="../misc/npm-config.html">npm-config(7)</a></code> for much much more information.</p>
<h2 id="contributions">CONTRIBUTIONS</h2>
<p>Patches welcome!</p>
<ul>
<li>code:
Read through <code><a href="../misc/npm-coding-style.html">npm-coding-style(7)</a></code> if you plan to submit code.
You don&#39;t have to agree with it, but you do have to follow it.</li>
<li>docs:
If you find an error in the documentation, edit the appropriate markdown
file in the &quot;doc&quot; folder. (Don&#39;t worry about generating the man page.)</li>
</ul>
<p>Contributors are listed in npm&#39;s <code>package.json</code> file. You can view them
easily by doing <code>npm view npm contributors</code>.</p>
<p>If you would like to contribute, but don&#39;t know what to work on, read
the contributing guidelines and check the issues list.</p>
<ul>
<li><a href="https://github.com/npm/npm/wiki/Contributing-Guidelines">https://github.com/npm/npm/wiki/Contributing-Guidelines</a></li>
<li><a href="https://github.com/npm/npm/issues">https://github.com/npm/npm/issues</a></li>
<li><a href="https://github.com/npm/cli/blob/latest/CONTRIBUTING.md">CONTRIBUTING.md</a></li>
<li><a href="https://npm.community/c/bugs">Bug tracker</a></li>
<li><a href="https://npm.community/c/support">Support tracker</a></li>
</ul>
<h2 id="bugs">BUGS</h2>
<p>When you find issues, please report them:</p>
<ul>
<li>web:
<a href="https://github.com/npm/npm/issues">https://github.com/npm/npm/issues</a></li>
<a href="https://npm.community/c/bugs">https://npm.community/c/bugs</a></li>
</ul>
<p>Be sure to include <em>all</em> of the output from the npm command that didn&#39;t work
as expected. The <code>npm-debug.log</code> file is also helpful to provide.</p>
<p>You can also look for isaacs in #node.js on irc://irc.freenode.net. He
will no doubt tell you to put the output in a gist or email.</p>
<p>Be sure to follow the template and bug reporting guidelines. You can also ask
for help in the <a href="https://npm.community/c/support">support forum</a> if you&#39;re
unsure if it&#39;s actually a bug or are having trouble coming up with a detailed
reproduction to report.</p>
<h2 id="author">AUTHOR</h2>
<p><a href="http://blog.izs.me/">Isaac Z. Schlueter</a> ::
<a href="https://github.com/isaacs/">isaacs</a> ::
<a href="http://twitter.com/izs">@izs</a> ::
<a href="mailto:&#x69;&#x40;&#105;&#122;&#115;&#46;&#109;&#x65;">&#x69;&#x40;&#105;&#122;&#115;&#46;&#109;&#x65;</a></p>
<a href="mailto:&#105;&#x40;&#x69;&#x7a;&#x73;&#x2e;&#109;&#x65;">&#105;&#x40;&#x69;&#x7a;&#x73;&#x2e;&#109;&#x65;</a></p>
<h2 id="see-also">SEE ALSO</h2>
<ul>
<li><a href="../cli/npm-help.html">npm-help(1)</a></li>
@ -150,5 +147,5 @@ will no doubt tell you to put the output in a gist or email.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm &mdash; npm@6.1.0</p>
<p id="footer">npm &mdash; npm@6.2.0</p>

View File

@ -121,8 +121,7 @@ highest level possible, below the localized &quot;target&quot; folder.</p>
| `-- asdf@*
`-- baz@1.2.3
`-- quux@3.x
`-- bar
</code></pre><p>In this case, we might expect a folder structure like this:</p>
`-- bar</code></pre><p>In this case, we might expect a folder structure like this:</p>
<pre><code>foo
+-- node_modules
+-- blerg (1.2.5) &lt;---[A]
@ -134,15 +133,14 @@ highest level possible, below the localized &quot;target&quot; folder.</p>
| `-- asdf (2.3.4)
`-- baz (1.2.3) &lt;---[D]
`-- node_modules
`-- quux (3.2.0) &lt;---[E]
</code></pre><p>Since foo depends directly on <a href="mailto:`bar@1.2.3">`bar@1.2.3</a><code>and</code><a href="mailto:baz@1.2.3">baz@1.2.3</a><code>, those are
`-- quux (3.2.0) &lt;---[E]</code></pre><p>Since foo depends directly on <a href="mailto:%60bar@1.2.3">`bar@1.2.3</a><code>and</code><a href="mailto:baz@1.2.3">baz@1.2.3</a><code>, those are
installed in foo&#39;s</code>node_modules` folder.</p>
<p>Even though the latest copy of blerg is 1.3.7, foo has a specific
dependency on version 1.2.5. So, that gets installed at [A]. Since the
parent installation of blerg satisfies bar&#39;s dependency on <a href="mailto:`blerg@1.x">`blerg@1.x</a>`,
parent installation of blerg satisfies bar&#39;s dependency on <a href="mailto:%60blerg@1.x">`blerg@1.x</a>`,
it does not install another copy under [B].</p>
<p>Bar [B] also has dependencies on baz and asdf, so those are installed in
bar&#39;s <code>node_modules</code> folder. Because it depends on <a href="mailto:`baz@2.x">`baz@2.x</a><code>, it cannot
bar&#39;s <code>node_modules</code> folder. Because it depends on <a href="mailto:%60baz@2.x">`baz@2.x</a><code>, it cannot
re-use the</code><a href="mailto:baz@1.2.3">baz@1.2.3</a><code>installed in the parent</code>node_modules` folder [D],
and must install its own copy [C].</p>
<p>Underneath bar, the <code>baz -&gt; quux -&gt; bar</code> dependency creates a cycle.
@ -181,5 +179,5 @@ cannot be found elsewhere. See <code><a href="../files/package.json.html">packa
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-folders &mdash; npm@6.1.0</p>
<p id="footer">npm-folders &mdash; npm@6.2.0</p>

View File

@ -121,8 +121,7 @@ highest level possible, below the localized &quot;target&quot; folder.</p>
| `-- asdf@*
`-- baz@1.2.3
`-- quux@3.x
`-- bar
</code></pre><p>In this case, we might expect a folder structure like this:</p>
`-- bar</code></pre><p>In this case, we might expect a folder structure like this:</p>
<pre><code>foo
+-- node_modules
+-- blerg (1.2.5) &lt;---[A]
@ -134,15 +133,14 @@ highest level possible, below the localized &quot;target&quot; folder.</p>
| `-- asdf (2.3.4)
`-- baz (1.2.3) &lt;---[D]
`-- node_modules
`-- quux (3.2.0) &lt;---[E]
</code></pre><p>Since foo depends directly on <a href="mailto:`bar@1.2.3">`bar@1.2.3</a><code>and</code><a href="mailto:baz@1.2.3">baz@1.2.3</a><code>, those are
`-- quux (3.2.0) &lt;---[E]</code></pre><p>Since foo depends directly on <a href="mailto:%60bar@1.2.3">`bar@1.2.3</a><code>and</code><a href="mailto:baz@1.2.3">baz@1.2.3</a><code>, those are
installed in foo&#39;s</code>node_modules` folder.</p>
<p>Even though the latest copy of blerg is 1.3.7, foo has a specific
dependency on version 1.2.5. So, that gets installed at [A]. Since the
parent installation of blerg satisfies bar&#39;s dependency on <a href="mailto:`blerg@1.x">`blerg@1.x</a>`,
parent installation of blerg satisfies bar&#39;s dependency on <a href="mailto:%60blerg@1.x">`blerg@1.x</a>`,
it does not install another copy under [B].</p>
<p>Bar [B] also has dependencies on baz and asdf, so those are installed in
bar&#39;s <code>node_modules</code> folder. Because it depends on <a href="mailto:`baz@2.x">`baz@2.x</a><code>, it cannot
bar&#39;s <code>node_modules</code> folder. Because it depends on <a href="mailto:%60baz@2.x">`baz@2.x</a><code>, it cannot
re-use the</code><a href="mailto:baz@1.2.3">baz@1.2.3</a><code>installed in the parent</code>node_modules` folder [D],
and must install its own copy [C].</p>
<p>Underneath bar, the <code>baz -&gt; quux -&gt; bar</code> dependency creates a cycle.
@ -181,5 +179,5 @@ cannot be found elsewhere. See <code><a href="../files/package.json.html">packa
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-folders &mdash; npm@6.1.0</p>
<p id="footer">npm-folders &mdash; npm@6.2.0</p>

View File

@ -63,16 +63,14 @@ discover your package as it&#39;s listed in <code>npm search</code>.</p>
<h2 id="homepage">homepage</h2>
<p>The url to the project homepage.</p>
<p>Example:</p>
<pre><code>&quot;homepage&quot;: &quot;https://github.com/owner/project#readme&quot;
</code></pre><h2 id="bugs">bugs</h2>
<pre><code>&quot;homepage&quot;: &quot;https://github.com/owner/project#readme&quot;</code></pre><h2 id="bugs">bugs</h2>
<p>The url to your project&#39;s issue tracker and / or the email address to which
issues should be reported. These are helpful for people who encounter issues
with your package.</p>
<p>It should look like this:</p>
<pre><code>{ &quot;url&quot; : &quot;https://github.com/owner/project/issues&quot;
, &quot;email&quot; : &quot;project@hostname.com&quot;
}
</code></pre><p>You can specify either one or both values. If you want to provide only a url,
}</code></pre><p>You can specify either one or both values. If you want to provide only a url,
you can specify the value for &quot;bugs&quot; as a simple string instead of an object.</p>
<p>If a url is provided, it will be used by the <code>npm bugs</code> command.</p>
<h2 id="license">license</h2>
@ -80,17 +78,14 @@ you can specify the value for &quot;bugs&quot; as a simple string instead of an
permitted to use it, and any restrictions you&#39;re placing on it.</p>
<p>If you&#39;re using a common license such as BSD-2-Clause or MIT, add a
current SPDX license identifier for the license you&#39;re using, like this:</p>
<pre><code>{ &quot;license&quot; : &quot;BSD-3-Clause&quot; }
</code></pre><p>You can check <a href="https://spdx.org/licenses/">the full list of SPDX license IDs</a>.
<pre><code>{ &quot;license&quot; : &quot;BSD-3-Clause&quot; }</code></pre><p>You can check <a href="https://spdx.org/licenses/">the full list of SPDX license IDs</a>.
Ideally you should pick one that is
<a href="https://opensource.org/licenses/alphabetical">OSI</a> approved.</p>
<p>If your package is licensed under multiple common licenses, use an <a href="https://npmjs.com/package/spdx">SPDX license
expression syntax version 2.0 string</a>, like this:</p>
<pre><code>{ &quot;license&quot; : &quot;(ISC OR GPL-3.0)&quot; }
</code></pre><p>If you are using a license that hasn&#39;t been assigned an SPDX identifier, or if
<pre><code>{ &quot;license&quot; : &quot;(ISC OR GPL-3.0)&quot; }</code></pre><p>If you are using a license that hasn&#39;t been assigned an SPDX identifier, or if
you are using a custom license, use a string value like this one:</p>
<pre><code>{ &quot;license&quot; : &quot;SEE LICENSE IN &lt;filename&gt;&quot; }
</code></pre><p>Then include a file named <code>&lt;filename&gt;</code> at the top level of the package.</p>
<pre><code>{ &quot;license&quot; : &quot;SEE LICENSE IN &lt;filename&gt;&quot; }</code></pre><p>Then include a file named <code>&lt;filename&gt;</code> at the top level of the package.</p>
<p>Some old packages used license objects or a &quot;licenses&quot; property containing an
array of license objects:</p>
<pre><code>// Not valid metadata
@ -110,25 +105,20 @@ array of license objects:</p>
, &quot;url&quot;: &quot;https://opensource.org/licenses/apache2.0.php&quot;
}
]
}
</code></pre><p>Those styles are now deprecated. Instead, use SPDX expressions, like this:</p>
}</code></pre><p>Those styles are now deprecated. Instead, use SPDX expressions, like this:</p>
<pre><code>{ &quot;license&quot;: &quot;ISC&quot; }
{ &quot;license&quot;: &quot;(MIT OR Apache-2.0)&quot; }
</code></pre><p>Finally, if you do not wish to grant others the right to use a private or
{ &quot;license&quot;: &quot;(MIT OR Apache-2.0)&quot; }</code></pre><p>Finally, if you do not wish to grant others the right to use a private or
unpublished package under any terms:</p>
<pre><code>{ &quot;license&quot;: &quot;UNLICENSED&quot; }
</code></pre><p>Consider also setting <code>&quot;private&quot;: true</code> to prevent accidental publication.</p>
<pre><code>{ &quot;license&quot;: &quot;UNLICENSED&quot; }</code></pre><p>Consider also setting <code>&quot;private&quot;: true</code> to prevent accidental publication.</p>
<h2 id="people-fields-author-contributors">people fields: author, contributors</h2>
<p>The &quot;author&quot; is one person. &quot;contributors&quot; is an array of people. A &quot;person&quot;
is an object with a &quot;name&quot; field and optionally &quot;url&quot; and &quot;email&quot;, like this:</p>
<pre><code>{ &quot;name&quot; : &quot;Barney Rubble&quot;
, &quot;email&quot; : &quot;b@rubble.com&quot;
, &quot;url&quot; : &quot;http://barnyrubble.tumblr.com/&quot;
}
</code></pre><p>Or you can shorten that all into a single string, and npm will parse it for you:</p>
<pre><code>&quot;Barney Rubble &lt;b@rubble.com&gt; (http://barnyrubble.tumblr.com/)&quot;
</code></pre><p>Both email and url are optional either way.</p>
}</code></pre><p>Or you can shorten that all into a single string, and npm will parse it for you:</p>
<pre><code>&quot;Barney Rubble &lt;b@rubble.com&gt; (http://barnyrubble.tumblr.com/)&quot;</code></pre><p>Both email and url are optional either way.</p>
<p>npm also sets a top-level &quot;maintainers&quot; field with your npm user info.</p>
<h2 id="files">files</h2>
<p>The optional <code>files</code> field is an array of file patterns that describes
@ -195,19 +185,16 @@ command name to local file name. On install, npm will symlink that file into
<code>prefix/bin</code> for global installs, or <code>./node_modules/.bin/</code> for local
installs.</p>
<p>For example, myapp could have this:</p>
<pre><code>{ &quot;bin&quot; : { &quot;myapp&quot; : &quot;./cli.js&quot; } }
</code></pre><p>So, when you install myapp, it&#39;ll create a symlink from the <code>cli.js</code> script to
<pre><code>{ &quot;bin&quot; : { &quot;myapp&quot; : &quot;./cli.js&quot; } }</code></pre><p>So, when you install myapp, it&#39;ll create a symlink from the <code>cli.js</code> script to
<code>/usr/local/bin/myapp</code>.</p>
<p>If you have a single executable, and its name should be the name
of the package, then you can just supply it as a string. For example:</p>
<pre><code>{ &quot;name&quot;: &quot;my-program&quot;
, &quot;version&quot;: &quot;1.2.5&quot;
, &quot;bin&quot;: &quot;./path/to/program&quot; }
</code></pre><p>would be the same as this:</p>
, &quot;bin&quot;: &quot;./path/to/program&quot; }</code></pre><p>would be the same as this:</p>
<pre><code>{ &quot;name&quot;: &quot;my-program&quot;
, &quot;version&quot;: &quot;1.2.5&quot;
, &quot;bin&quot; : { &quot;my-program&quot; : &quot;./path/to/program&quot; } }
</code></pre><p>Please make sure that your file(s) referenced in <code>bin</code> starts with
, &quot;bin&quot; : { &quot;my-program&quot; : &quot;./path/to/program&quot; } }</code></pre><p>Please make sure that your file(s) referenced in <code>bin</code> starts with
<code>#!/usr/bin/env node</code>, otherwise the scripts are started without the node
executable!</p>
<h2 id="man">man</h2>
@ -220,8 +207,7 @@ result from <code>man &lt;pkgname&gt;</code>, regardless of its actual filename.
, &quot;description&quot; : &quot;A packaged foo fooer for fooing foos&quot;
, &quot;main&quot; : &quot;foo.js&quot;
, &quot;man&quot; : &quot;./man/doc.1&quot;
}
</code></pre><p>would link the <code>./man/doc.1</code> file in such that it is the target for <code>man foo</code></p>
}</code></pre><p>would link the <code>./man/doc.1</code> file in such that it is the target for <code>man foo</code></p>
<p>If the filename doesn&#39;t start with the package name, then it&#39;s prefixed.
So, this:</p>
<pre><code>{ &quot;name&quot; : &quot;foo&quot;
@ -229,8 +215,7 @@ So, this:</p>
, &quot;description&quot; : &quot;A packaged foo fooer for fooing foos&quot;
, &quot;main&quot; : &quot;foo.js&quot;
, &quot;man&quot; : [ &quot;./man/foo.1&quot;, &quot;./man/bar.1&quot; ]
}
</code></pre><p>will create files to do <code>man foo</code> and <code>man foo-bar</code>.</p>
}</code></pre><p>will create files to do <code>man foo</code> and <code>man foo-bar</code>.</p>
<p>Man files must end with a number, and optionally a <code>.gz</code> suffix if they are
compressed. The number dictates which man section the file is installed into.</p>
<pre><code>{ &quot;name&quot; : &quot;foo&quot;
@ -238,8 +223,7 @@ compressed. The number dictates which man section the file is installed into.</
, &quot;description&quot; : &quot;A packaged foo fooer for fooing foos&quot;
, &quot;main&quot; : &quot;foo.js&quot;
, &quot;man&quot; : [ &quot;./man/foo.1&quot;, &quot;./man/foo.2&quot; ]
}
</code></pre><p>will create entries for <code>man foo</code> and <code>man 2 foo</code></p>
}</code></pre><p>will create entries for <code>man foo</code> and <code>man 2 foo</code></p>
<h2 id="directories">directories</h2>
<p>The CommonJS <a href="http://wiki.commonjs.org/wiki/Packages/1.0">Packages</a> spec details a
few ways that you can indicate the structure of your package using a <code>directories</code>
@ -274,14 +258,13 @@ command will be able to find you.</p>
<p>Do it like this:</p>
<pre><code>&quot;repository&quot; :
{ &quot;type&quot; : &quot;git&quot;
, &quot;url&quot; : &quot;https://github.com/npm/npm.git&quot;
, &quot;url&quot; : &quot;https://github.com/npm/cli.git&quot;
}
&quot;repository&quot; :
{ &quot;type&quot; : &quot;svn&quot;
, &quot;url&quot; : &quot;https://v8.googlecode.com/svn/trunk/&quot;
}
</code></pre><p>The URL should be a publicly available (perhaps read-only) url that can be handed
}</code></pre><p>The URL should be a publicly available (perhaps read-only) url that can be handed
directly to a VCS program without any modification. It should not be a url to an
html project page that you put in your browser. It&#39;s for computers.</p>
<p>For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same
@ -294,8 +277,7 @@ shortcut syntax you use for <code>npm install</code>:</p>
&quot;repository&quot;: &quot;bitbucket:user/repo&quot;
&quot;repository&quot;: &quot;gitlab:user/repo&quot;
</code></pre><h2 id="scripts">scripts</h2>
&quot;repository&quot;: &quot;gitlab:user/repo&quot;</code></pre><h2 id="scripts">scripts</h2>
<p>The &quot;scripts&quot; property is a dictionary containing script commands that are run
at various times in the lifecycle of your package. The key is the lifecycle
event, and the value is the command to run at that point.</p>
@ -305,8 +287,7 @@ event, and the value is the command to run at that point.</p>
scripts that persist across upgrades. For instance, if a package had the
following:</p>
<pre><code>{ &quot;name&quot; : &quot;foo&quot;
, &quot;config&quot; : { &quot;port&quot; : &quot;8080&quot; } }
</code></pre><p>and then had a &quot;start&quot; command that then referenced the
, &quot;config&quot; : { &quot;port&quot; : &quot;8080&quot; } }</code></pre><p>and then had a &quot;start&quot; command that then referenced the
<code>npm_package_config_port</code> environment variable, then the user could
override that by doing <code>npm config set foo:port 8001</code>.</p>
<p>See <code><a href="../misc/npm-config.html">npm-config(7)</a></code> and <code><a href="../misc/npm-scripts.html">npm-scripts(7)</a></code> for more on package
@ -353,15 +334,13 @@ tarball or git URL.</p>
, &quot;lat&quot; : &quot;latest&quot;
, &quot;dyl&quot; : &quot;file:../dyl&quot;
}
}
</code></pre><h3 id="urls-as-dependencies">URLs as Dependencies</h3>
}</code></pre><h3 id="urls-as-dependencies">URLs as Dependencies</h3>
<p>You may specify a tarball URL in place of a version range.</p>
<p>This tarball will be downloaded and installed locally to your package at
install time.</p>
<h3 id="git-urls-as-dependencies">Git URLs as Dependencies</h3>
<p>Git urls are of the form:</p>
<pre><code>&lt;protocol&gt;://[&lt;user&gt;[:&lt;password&gt;]@]&lt;hostname&gt;[:&lt;port&gt;][:][/]&lt;path&gt;[#&lt;commit-ish&gt; | #semver:&lt;semver&gt;]
</code></pre><p><code>&lt;protocol&gt;</code> is one of <code>git</code>, <code>git+ssh</code>, <code>git+http</code>, <code>git+https</code>, or
<pre><code>&lt;protocol&gt;://[&lt;user&gt;[:&lt;password&gt;]@]&lt;hostname&gt;[:&lt;port&gt;][:][/]&lt;path&gt;[#&lt;commit-ish&gt; | #semver:&lt;semver&gt;]</code></pre><p><code>&lt;protocol&gt;</code> is one of <code>git</code>, <code>git+ssh</code>, <code>git+http</code>, <code>git+https</code>, or
<code>git+file</code>.</p>
<p>If <code>#&lt;commit-ish&gt;</code> is provided, it will be used to clone exactly that
commit. If the commit-ish has the format <code>#semver:&lt;semver&gt;</code>, <code>&lt;semver&gt;</code> can
@ -370,11 +349,10 @@ or refs matching that range in the remote repository, much as it would for a
registry dependency. If neither <code>#&lt;commit-ish&gt;</code> or <code>#semver:&lt;semver&gt;</code> is
specified, then <code>master</code> is used.</p>
<p>Examples:</p>
<pre><code>git+ssh://git@github.com:npm/npm.git#v1.0.27
git+ssh://git@github.com:npm/npm#semver:^5.0
git+https://isaacs@github.com/npm/npm.git
git://github.com/npm/npm.git#v1.0.27
</code></pre><h3 id="github-urls">GitHub URLs</h3>
<pre><code>git+ssh://git@github.com:npm/cli.git#v1.0.27
git+ssh://git@github.com:npm/cli#semver:^5.0
git+https://isaacs@github.com/npm/cli.git
git://github.com/npm/cli.git#v1.0.27</code></pre><h3 id="github-urls">GitHub URLs</h3>
<p>As of version 1.1.65, you can refer to GitHub urls as just &quot;foo&quot;:
&quot;user/foo-project&quot;. Just as with git URLs, a <code>commit-ish</code> suffix can be
included. For example:</p>
@ -386,24 +364,21 @@ included. For example:</p>
&quot;mocha&quot;: &quot;mochajs/mocha#4727d357ea&quot;,
&quot;module&quot;: &quot;user/repo#feature\/branch&quot;
}
}
</code></pre><h3 id="local-paths">Local Paths</h3>
}</code></pre><h3 id="local-paths">Local Paths</h3>
<p>As of version 2.0.0 you can provide a path to a local directory that contains a
package. Local paths can be saved using <code>npm install -S</code> or
<code>npm install --save</code>, using any of these forms:</p>
<pre><code>../foo/bar
~/foo/bar
./foo/bar
/foo/bar
</code></pre><p>in which case they will be normalized to a relative path and added to your
/foo/bar</code></pre><p>in which case they will be normalized to a relative path and added to your
<code>package.json</code>. For example:</p>
<pre><code>{
&quot;name&quot;: &quot;baz&quot;,
&quot;dependencies&quot;: {
&quot;bar&quot;: &quot;file:../foo/bar&quot;
}
}
</code></pre><p>This feature is helpful for local offline development and creating
}</code></pre><p>This feature is helpful for local offline development and creating
tests that require npm installing where you don&#39;t want to hit an
external server, but should not be used when publishing packages
to the public registry.</p>
@ -430,8 +405,7 @@ script to do this, and make the required package a devDependency.</p>
&quot;prepare&quot;: &quot;coffee -o lib/ -c src/waza.coffee&quot;
},
&quot;main&quot;: &quot;lib/waza.js&quot;
}
</code></pre><p>The <code>prepare</code> script will be run before publishing, so that users
}</code></pre><p>The <code>prepare</code> script will be run before publishing, so that users
can consume the functionality without requiring them to compile it
themselves. In dev mode (ie, locally running <code>npm install</code>), it&#39;ll
run this script as well, so that you can test it easily.</p>
@ -447,13 +421,11 @@ a specific interface, expected and specified by the host documentation.</p>
&quot;peerDependencies&quot;: {
&quot;tea&quot;: &quot;2.x&quot;
}
}
</code></pre><p>This ensures your package <code>tea-latte</code> can be installed <em>along</em> with the second
}</code></pre><p>This ensures your package <code>tea-latte</code> can be installed <em>along</em> with the second
major version of the host package <code>tea</code> only. <code>npm install tea-latte</code> could
possibly yield the following dependency graph:</p>
<pre><code>├── tea-latte@1.3.5
└── tea@2.2.0
</code></pre><p><strong>NOTE: npm versions 1 and 2 will automatically install <code>peerDependencies</code> if
└── tea@2.2.0</code></pre><p><strong>NOTE: npm versions 1 and 2 will automatically install <code>peerDependencies</code> if
they are not explicitly depended upon higher in the dependency tree. In the
next major version of npm (npm@3), this will no longer be the case. You will
receive a warning that the peerDependency is not installed instead.</strong> The
@ -481,8 +453,7 @@ array and executing <code>npm pack</code>.</p>
&quot;bundledDependencies&quot;: [
&quot;renderized&quot;, &quot;super-streams&quot;
]
}
</code></pre><p>we can obtain <code>awesome-web-framework-1.0.0.tgz</code> file by running <code>npm pack</code>.
}</code></pre><p>we can obtain <code>awesome-web-framework-1.0.0.tgz</code> file by running <code>npm pack</code>.
This file contains the dependencies <code>renderized</code> and <code>super-streams</code> which
can be installed in a new project by executing <code>npm install
awesome-web-framework-1.0.0.tgz</code>.</p>
@ -509,21 +480,18 @@ if ( notGoodFooVersion(fooVersion) ) {
if (foo) {
foo.doFooThings()
}
</code></pre><p>Entries in <code>optionalDependencies</code> will override entries of the same name in
}</code></pre><p>Entries in <code>optionalDependencies</code> will override entries of the same name in
<code>dependencies</code>, so it&#39;s usually best to only put in one place.</p>
<h2 id="engines">engines</h2>
<p>You can specify the version of node that your stuff works on:</p>
<pre><code>{ &quot;engines&quot; : { &quot;node&quot; : &quot;&gt;=0.10.3 &lt;0.12&quot; } }
</code></pre><p>And, like with dependencies, if you don&#39;t specify the version (or if you
<pre><code>{ &quot;engines&quot; : { &quot;node&quot; : &quot;&gt;=0.10.3 &lt;0.12&quot; } }</code></pre><p>And, like with dependencies, if you don&#39;t specify the version (or if you
specify &quot;*&quot; as the version), then any version of node will do.</p>
<p>If you specify an &quot;engines&quot; field, then npm will require that &quot;node&quot; be
somewhere on that list. If &quot;engines&quot; is omitted, then npm will just assume
that it works on node.</p>
<p>You can also use the &quot;engines&quot; field to specify which versions of npm
are capable of properly installing your program. For example:</p>
<pre><code>{ &quot;engines&quot; : { &quot;npm&quot; : &quot;~1.0.20&quot; } }
</code></pre><p>Unless the user has set the <code>engine-strict</code> config flag, this
<pre><code>{ &quot;engines&quot; : { &quot;npm&quot; : &quot;~1.0.20&quot; } }</code></pre><p>Unless the user has set the <code>engine-strict</code> config flag, this
field is advisory only and will only produce warnings when your package is installed as a dependency.</p>
<h2 id="enginestrict">engineStrict</h2>
<p><strong>This feature was removed in npm 3.0.0</strong></p>
@ -532,20 +500,16 @@ user had set <code>engine-strict</code>. It is no longer used.</p>
<h2 id="os">os</h2>
<p>You can specify which operating systems your
module will run on:</p>
<pre><code>&quot;os&quot; : [ &quot;darwin&quot;, &quot;linux&quot; ]
</code></pre><p>You can also blacklist instead of whitelist operating systems,
<pre><code>&quot;os&quot; : [ &quot;darwin&quot;, &quot;linux&quot; ]</code></pre><p>You can also blacklist instead of whitelist operating systems,
just prepend the blacklisted os with a &#39;!&#39;:</p>
<pre><code>&quot;os&quot; : [ &quot;!win32&quot; ]
</code></pre><p>The host operating system is determined by <code>process.platform</code></p>
<pre><code>&quot;os&quot; : [ &quot;!win32&quot; ]</code></pre><p>The host operating system is determined by <code>process.platform</code></p>
<p>It is allowed to both blacklist, and whitelist, although there isn&#39;t any
good reason to do this.</p>
<h2 id="cpu">cpu</h2>
<p>If your code only runs on certain cpu architectures,
you can specify which ones.</p>
<pre><code>&quot;cpu&quot; : [ &quot;x64&quot;, &quot;ia32&quot; ]
</code></pre><p>Like the <code>os</code> option, you can also blacklist architectures:</p>
<pre><code>&quot;cpu&quot; : [ &quot;!arm&quot;, &quot;!mips&quot; ]
</code></pre><p>The host architecture is determined by <code>process.arch</code></p>
<pre><code>&quot;cpu&quot; : [ &quot;x64&quot;, &quot;ia32&quot; ]</code></pre><p>Like the <code>os</code> option, you can also blacklist architectures:</p>
<pre><code>&quot;cpu&quot; : [ &quot;!arm&quot;, &quot;!mips&quot; ]</code></pre><p>The host architecture is determined by <code>process.arch</code></p>
<h2 id="preferglobal">preferGlobal</h2>
<p><strong>DEPRECATED</strong></p>
<p>This option used to trigger an npm warning, but it will no longer warn. It is
@ -610,5 +574,5 @@ ignored.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">package.json &mdash; npm@6.1.0</p>
<p id="footer">package.json &mdash; npm@6.2.0</p>

View File

@ -34,31 +34,26 @@ unable to do this. There are multiple reasons for this:</p>
&quot;dependencies&quot;: {
&quot;B&quot;: &quot;&lt;0.1.0&quot;
}
}
</code></pre><p>package B:</p>
}</code></pre><p>package B:</p>
<pre><code>{
&quot;name&quot;: &quot;B&quot;,
&quot;version&quot;: &quot;0.0.1&quot;,
&quot;dependencies&quot;: {
&quot;C&quot;: &quot;&lt;0.1.0&quot;
}
}
</code></pre><p>and package C:</p>
}</code></pre><p>and package C:</p>
<pre><code>{
&quot;name&quot;: &quot;C&quot;,
&quot;version&quot;: &quot;0.0.1&quot;
}
</code></pre><p>If these are the only versions of A, B, and C available in the
}</code></pre><p>If these are the only versions of A, B, and C available in the
registry, then a normal <code>npm install A</code> will install:</p>
<pre><code>A@0.1.0
`-- B@0.0.1
`-- C@0.0.1
</code></pre><p>However, if <a href="mailto:B@0.0.2">B@0.0.2</a> is published, then a fresh <code>npm install A</code> will
`-- C@0.0.1</code></pre><p>However, if <a href="mailto:B@0.0.2">B@0.0.2</a> is published, then a fresh <code>npm install A</code> will
install:</p>
<pre><code>A@0.1.0
`-- B@0.0.2
`-- C@0.0.1
</code></pre><p>assuming the new version did not modify B&#39;s dependencies. Of course,
`-- C@0.0.1</code></pre><p>assuming the new version did not modify B&#39;s dependencies. Of course,
the new version of B could include a new version of C and any number
of new dependencies. If such changes are undesirable, the author of A
could specify a dependency on <a href="mailto:B@0.0.1">B@0.0.1</a>. However, if A&#39;s author and B&#39;s
@ -85,8 +80,7 @@ which will look something like this:</p>
}
}
}
}
</code></pre><p>This file describes an <em>exact</em>, and more importantly <em>reproducible</em>
}</code></pre><p>This file describes an <em>exact</em>, and more importantly <em>reproducible</em>
<code>node_modules</code> tree. Once it&#39;s present, any future installation will base its
work off this file, instead of recalculating dependency versions off
p<a href="../files/ackage.json.html">ackage.json(5)</a>.</p>
@ -109,8 +103,7 @@ executed afterwards. These scripts run for both <code>package-lock.json</code> a
file:</p>
<pre><code>&quot;scripts&quot;: {
&quot;postshrinkwrap&quot;: &quot;json -I -e \&quot;this.myMetadata = $MY_APP_METADATA\&quot;&quot;
}
</code></pre><h3 id="using-locked-packages">Using locked packages</h3>
}</code></pre><h3 id="using-locked-packages">Using locked packages</h3>
<p>Using a locked package is no different than using any package without a package
lock: any commands that update <code>node_modules</code> and/or <code>package.json</code>&#39;s
dependencies will automatically sync the existing lockfile. This includes <code>npm
@ -127,7 +120,7 @@ inform you of any changes npm has made to your <code>node_modules</code>, so you
if any transitive dependencies were updated, hoisted, etc.</p>
<h3 id="resolving-lockfile-conflicts">Resolving lockfile conflicts</h3>
<p>Occasionally, two separate npm install will create package locks that cause
merge conflicts in source control systems. As of <a href="mailto:`npm@5.7.0">`npm@5.7.0</a><code>, these conflicts
merge conflicts in source control systems. As of <a href="mailto:%60npm@5.7.0">`npm@5.7.0</a><code>, these conflicts
can be resolved by manually fixing any</code>package.json<code>conflicts, and then
running</code>npm install [--package-lock-only]<code>again. npm will automatically
resolve any conflicts for you and write a merged package lock that includes all
@ -137,7 +130,7 @@ local</code>node_modules/`.</p>
<a href="https://npm.im/npm-merge-driver"><code>npm-merge-driver</code></a>, which will teach git how
to do this itself without any user interaction. In short: <code>$ npx
npm-merge-driver install -g</code> will let you do this, and even works with
<a href="mailto:pre-`npm@5.7.0">pre-`npm@5.7.0</a><code>versions of npm 5, albeit a bit more noisily. Note that if</code>package.json<code>itself conflicts, you will have to resolve that by hand and run</code>npm install` manually, even with the merge driver.</p>
<a href="mailto:pre-%60npm@5.7.0">pre-`npm@5.7.0</a><code>versions of npm 5, albeit a bit more noisily. Note that if</code>package.json<code>itself conflicts, you will have to resolve that by hand and run</code>npm install` manually, even with the merge driver.</p>
<h2 id="see-also">SEE ALSO</h2>
<ul>
<li><a href="https://medium.com/@sdboyer/so-you-want-to-write-a-package-manager-4ae9c17d9527">https://medium.com/@sdboyer/so-you-want-to-write-a-package-manager-4ae9c17d9527</a></li>
@ -158,4 +151,4 @@ npm-merge-driver install -g</code> will let you do this, and even works with
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-package-locks &mdash; npm@6.1.0</p>
<p id="footer">npm-package-locks &mdash; npm@6.2.0</p>

View File

@ -42,4 +42,4 @@ to the manual page for <a href="../files/package-lock.json.html">package-lock.js
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-shrinkwrap.json &mdash; npm@6.1.0</p>
<p id="footer">npm-shrinkwrap.json &mdash; npm@6.2.0</p>

View File

@ -27,21 +27,18 @@ of the user and global npmrc files.</p>
<p>All npm config files are an ini-formatted list of <code>key = value</code>
parameters. Environment variables can be replaced using
<code>${VARIABLE_NAME}</code>. For example:</p>
<pre><code>prefix = ${HOME}/.npm-packages
</code></pre><p>Each of these files is loaded, and config options are resolved in
<pre><code>prefix = ${HOME}/.npm-packages</code></pre><p>Each of these files is loaded, and config options are resolved in
priority order. For example, a setting in the userconfig file would
override the setting in the globalconfig file.</p>
<p>Array values are specified by adding &quot;[]&quot; after the key name. For
example:</p>
<pre><code>key[] = &quot;first value&quot;
key[] = &quot;second value&quot;
</code></pre><h4 id="comments">Comments</h4>
key[] = &quot;second value&quot;</code></pre><h4 id="comments">Comments</h4>
<p>Lines in <code>.npmrc</code> files are interpreted as comments when they begin with a <code>;</code> or <code>#</code> character. <code>.npmrc</code> files are parsed by <a href="https://github.com/npm/ini">npm/ini</a>, which specifies this comment syntax.</p>
<p>For example:</p>
<pre><code># last modified: 01 Jan 2016
; Set a new registry for a scoped package
@myscope:registry=https://mycustomregistry.example.org
</code></pre><h3 id="per-project-config-file">Per-project config file</h3>
@myscope:registry=https://mycustomregistry.example.org</code></pre><h3 id="per-project-config-file">Per-project config file</h3>
<p>When working locally in a project, a <code>.npmrc</code> file in the root of the
project (ie, a sibling of <code>node_modules</code> and <code>package.json</code>) will set
config values specific to this project.</p>
@ -85,5 +82,5 @@ manner.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npmrc &mdash; npm@6.1.0</p>
<p id="footer">npmrc &mdash; npm@6.2.0</p>

View File

@ -130,4 +130,4 @@ should match via normal matching rules a dependency either in our
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">package-lock.json &mdash; npm@6.1.0</p>
<p id="footer">package-lock.json &mdash; npm@6.2.0</p>

View File

@ -63,16 +63,14 @@ discover your package as it&#39;s listed in <code>npm search</code>.</p>
<h2 id="homepage">homepage</h2>
<p>The url to the project homepage.</p>
<p>Example:</p>
<pre><code>&quot;homepage&quot;: &quot;https://github.com/owner/project#readme&quot;
</code></pre><h2 id="bugs">bugs</h2>
<pre><code>&quot;homepage&quot;: &quot;https://github.com/owner/project#readme&quot;</code></pre><h2 id="bugs">bugs</h2>
<p>The url to your project&#39;s issue tracker and / or the email address to which
issues should be reported. These are helpful for people who encounter issues
with your package.</p>
<p>It should look like this:</p>
<pre><code>{ &quot;url&quot; : &quot;https://github.com/owner/project/issues&quot;
, &quot;email&quot; : &quot;project@hostname.com&quot;
}
</code></pre><p>You can specify either one or both values. If you want to provide only a url,
}</code></pre><p>You can specify either one or both values. If you want to provide only a url,
you can specify the value for &quot;bugs&quot; as a simple string instead of an object.</p>
<p>If a url is provided, it will be used by the <code>npm bugs</code> command.</p>
<h2 id="license">license</h2>
@ -80,17 +78,14 @@ you can specify the value for &quot;bugs&quot; as a simple string instead of an
permitted to use it, and any restrictions you&#39;re placing on it.</p>
<p>If you&#39;re using a common license such as BSD-2-Clause or MIT, add a
current SPDX license identifier for the license you&#39;re using, like this:</p>
<pre><code>{ &quot;license&quot; : &quot;BSD-3-Clause&quot; }
</code></pre><p>You can check <a href="https://spdx.org/licenses/">the full list of SPDX license IDs</a>.
<pre><code>{ &quot;license&quot; : &quot;BSD-3-Clause&quot; }</code></pre><p>You can check <a href="https://spdx.org/licenses/">the full list of SPDX license IDs</a>.
Ideally you should pick one that is
<a href="https://opensource.org/licenses/alphabetical">OSI</a> approved.</p>
<p>If your package is licensed under multiple common licenses, use an <a href="https://npmjs.com/package/spdx">SPDX license
expression syntax version 2.0 string</a>, like this:</p>
<pre><code>{ &quot;license&quot; : &quot;(ISC OR GPL-3.0)&quot; }
</code></pre><p>If you are using a license that hasn&#39;t been assigned an SPDX identifier, or if
<pre><code>{ &quot;license&quot; : &quot;(ISC OR GPL-3.0)&quot; }</code></pre><p>If you are using a license that hasn&#39;t been assigned an SPDX identifier, or if
you are using a custom license, use a string value like this one:</p>
<pre><code>{ &quot;license&quot; : &quot;SEE LICENSE IN &lt;filename&gt;&quot; }
</code></pre><p>Then include a file named <code>&lt;filename&gt;</code> at the top level of the package.</p>
<pre><code>{ &quot;license&quot; : &quot;SEE LICENSE IN &lt;filename&gt;&quot; }</code></pre><p>Then include a file named <code>&lt;filename&gt;</code> at the top level of the package.</p>
<p>Some old packages used license objects or a &quot;licenses&quot; property containing an
array of license objects:</p>
<pre><code>// Not valid metadata
@ -110,25 +105,20 @@ array of license objects:</p>
, &quot;url&quot;: &quot;https://opensource.org/licenses/apache2.0.php&quot;
}
]
}
</code></pre><p>Those styles are now deprecated. Instead, use SPDX expressions, like this:</p>
}</code></pre><p>Those styles are now deprecated. Instead, use SPDX expressions, like this:</p>
<pre><code>{ &quot;license&quot;: &quot;ISC&quot; }
{ &quot;license&quot;: &quot;(MIT OR Apache-2.0)&quot; }
</code></pre><p>Finally, if you do not wish to grant others the right to use a private or
{ &quot;license&quot;: &quot;(MIT OR Apache-2.0)&quot; }</code></pre><p>Finally, if you do not wish to grant others the right to use a private or
unpublished package under any terms:</p>
<pre><code>{ &quot;license&quot;: &quot;UNLICENSED&quot; }
</code></pre><p>Consider also setting <code>&quot;private&quot;: true</code> to prevent accidental publication.</p>
<pre><code>{ &quot;license&quot;: &quot;UNLICENSED&quot; }</code></pre><p>Consider also setting <code>&quot;private&quot;: true</code> to prevent accidental publication.</p>
<h2 id="people-fields-author-contributors">people fields: author, contributors</h2>
<p>The &quot;author&quot; is one person. &quot;contributors&quot; is an array of people. A &quot;person&quot;
is an object with a &quot;name&quot; field and optionally &quot;url&quot; and &quot;email&quot;, like this:</p>
<pre><code>{ &quot;name&quot; : &quot;Barney Rubble&quot;
, &quot;email&quot; : &quot;b@rubble.com&quot;
, &quot;url&quot; : &quot;http://barnyrubble.tumblr.com/&quot;
}
</code></pre><p>Or you can shorten that all into a single string, and npm will parse it for you:</p>
<pre><code>&quot;Barney Rubble &lt;b@rubble.com&gt; (http://barnyrubble.tumblr.com/)&quot;
</code></pre><p>Both email and url are optional either way.</p>
}</code></pre><p>Or you can shorten that all into a single string, and npm will parse it for you:</p>
<pre><code>&quot;Barney Rubble &lt;b@rubble.com&gt; (http://barnyrubble.tumblr.com/)&quot;</code></pre><p>Both email and url are optional either way.</p>
<p>npm also sets a top-level &quot;maintainers&quot; field with your npm user info.</p>
<h2 id="files">files</h2>
<p>The optional <code>files</code> field is an array of file patterns that describes
@ -195,19 +185,16 @@ command name to local file name. On install, npm will symlink that file into
<code>prefix/bin</code> for global installs, or <code>./node_modules/.bin/</code> for local
installs.</p>
<p>For example, myapp could have this:</p>
<pre><code>{ &quot;bin&quot; : { &quot;myapp&quot; : &quot;./cli.js&quot; } }
</code></pre><p>So, when you install myapp, it&#39;ll create a symlink from the <code>cli.js</code> script to
<pre><code>{ &quot;bin&quot; : { &quot;myapp&quot; : &quot;./cli.js&quot; } }</code></pre><p>So, when you install myapp, it&#39;ll create a symlink from the <code>cli.js</code> script to
<code>/usr/local/bin/myapp</code>.</p>
<p>If you have a single executable, and its name should be the name
of the package, then you can just supply it as a string. For example:</p>
<pre><code>{ &quot;name&quot;: &quot;my-program&quot;
, &quot;version&quot;: &quot;1.2.5&quot;
, &quot;bin&quot;: &quot;./path/to/program&quot; }
</code></pre><p>would be the same as this:</p>
, &quot;bin&quot;: &quot;./path/to/program&quot; }</code></pre><p>would be the same as this:</p>
<pre><code>{ &quot;name&quot;: &quot;my-program&quot;
, &quot;version&quot;: &quot;1.2.5&quot;
, &quot;bin&quot; : { &quot;my-program&quot; : &quot;./path/to/program&quot; } }
</code></pre><p>Please make sure that your file(s) referenced in <code>bin</code> starts with
, &quot;bin&quot; : { &quot;my-program&quot; : &quot;./path/to/program&quot; } }</code></pre><p>Please make sure that your file(s) referenced in <code>bin</code> starts with
<code>#!/usr/bin/env node</code>, otherwise the scripts are started without the node
executable!</p>
<h2 id="man">man</h2>
@ -220,8 +207,7 @@ result from <code>man &lt;pkgname&gt;</code>, regardless of its actual filename.
, &quot;description&quot; : &quot;A packaged foo fooer for fooing foos&quot;
, &quot;main&quot; : &quot;foo.js&quot;
, &quot;man&quot; : &quot;./man/doc.1&quot;
}
</code></pre><p>would link the <code>./man/doc.1</code> file in such that it is the target for <code>man foo</code></p>
}</code></pre><p>would link the <code>./man/doc.1</code> file in such that it is the target for <code>man foo</code></p>
<p>If the filename doesn&#39;t start with the package name, then it&#39;s prefixed.
So, this:</p>
<pre><code>{ &quot;name&quot; : &quot;foo&quot;
@ -229,8 +215,7 @@ So, this:</p>
, &quot;description&quot; : &quot;A packaged foo fooer for fooing foos&quot;
, &quot;main&quot; : &quot;foo.js&quot;
, &quot;man&quot; : [ &quot;./man/foo.1&quot;, &quot;./man/bar.1&quot; ]
}
</code></pre><p>will create files to do <code>man foo</code> and <code>man foo-bar</code>.</p>
}</code></pre><p>will create files to do <code>man foo</code> and <code>man foo-bar</code>.</p>
<p>Man files must end with a number, and optionally a <code>.gz</code> suffix if they are
compressed. The number dictates which man section the file is installed into.</p>
<pre><code>{ &quot;name&quot; : &quot;foo&quot;
@ -238,8 +223,7 @@ compressed. The number dictates which man section the file is installed into.</
, &quot;description&quot; : &quot;A packaged foo fooer for fooing foos&quot;
, &quot;main&quot; : &quot;foo.js&quot;
, &quot;man&quot; : [ &quot;./man/foo.1&quot;, &quot;./man/foo.2&quot; ]
}
</code></pre><p>will create entries for <code>man foo</code> and <code>man 2 foo</code></p>
}</code></pre><p>will create entries for <code>man foo</code> and <code>man 2 foo</code></p>
<h2 id="directories">directories</h2>
<p>The CommonJS <a href="http://wiki.commonjs.org/wiki/Packages/1.0">Packages</a> spec details a
few ways that you can indicate the structure of your package using a <code>directories</code>
@ -274,14 +258,13 @@ command will be able to find you.</p>
<p>Do it like this:</p>
<pre><code>&quot;repository&quot; :
{ &quot;type&quot; : &quot;git&quot;
, &quot;url&quot; : &quot;https://github.com/npm/npm.git&quot;
, &quot;url&quot; : &quot;https://github.com/npm/cli.git&quot;
}
&quot;repository&quot; :
{ &quot;type&quot; : &quot;svn&quot;
, &quot;url&quot; : &quot;https://v8.googlecode.com/svn/trunk/&quot;
}
</code></pre><p>The URL should be a publicly available (perhaps read-only) url that can be handed
}</code></pre><p>The URL should be a publicly available (perhaps read-only) url that can be handed
directly to a VCS program without any modification. It should not be a url to an
html project page that you put in your browser. It&#39;s for computers.</p>
<p>For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same
@ -294,8 +277,7 @@ shortcut syntax you use for <code>npm install</code>:</p>
&quot;repository&quot;: &quot;bitbucket:user/repo&quot;
&quot;repository&quot;: &quot;gitlab:user/repo&quot;
</code></pre><h2 id="scripts">scripts</h2>
&quot;repository&quot;: &quot;gitlab:user/repo&quot;</code></pre><h2 id="scripts">scripts</h2>
<p>The &quot;scripts&quot; property is a dictionary containing script commands that are run
at various times in the lifecycle of your package. The key is the lifecycle
event, and the value is the command to run at that point.</p>
@ -305,8 +287,7 @@ event, and the value is the command to run at that point.</p>
scripts that persist across upgrades. For instance, if a package had the
following:</p>
<pre><code>{ &quot;name&quot; : &quot;foo&quot;
, &quot;config&quot; : { &quot;port&quot; : &quot;8080&quot; } }
</code></pre><p>and then had a &quot;start&quot; command that then referenced the
, &quot;config&quot; : { &quot;port&quot; : &quot;8080&quot; } }</code></pre><p>and then had a &quot;start&quot; command that then referenced the
<code>npm_package_config_port</code> environment variable, then the user could
override that by doing <code>npm config set foo:port 8001</code>.</p>
<p>See <code><a href="../misc/npm-config.html">npm-config(7)</a></code> and <code><a href="../misc/npm-scripts.html">npm-scripts(7)</a></code> for more on package
@ -353,15 +334,13 @@ tarball or git URL.</p>
, &quot;lat&quot; : &quot;latest&quot;
, &quot;dyl&quot; : &quot;file:../dyl&quot;
}
}
</code></pre><h3 id="urls-as-dependencies">URLs as Dependencies</h3>
}</code></pre><h3 id="urls-as-dependencies">URLs as Dependencies</h3>
<p>You may specify a tarball URL in place of a version range.</p>
<p>This tarball will be downloaded and installed locally to your package at
install time.</p>
<h3 id="git-urls-as-dependencies">Git URLs as Dependencies</h3>
<p>Git urls are of the form:</p>
<pre><code>&lt;protocol&gt;://[&lt;user&gt;[:&lt;password&gt;]@]&lt;hostname&gt;[:&lt;port&gt;][:][/]&lt;path&gt;[#&lt;commit-ish&gt; | #semver:&lt;semver&gt;]
</code></pre><p><code>&lt;protocol&gt;</code> is one of <code>git</code>, <code>git+ssh</code>, <code>git+http</code>, <code>git+https</code>, or
<pre><code>&lt;protocol&gt;://[&lt;user&gt;[:&lt;password&gt;]@]&lt;hostname&gt;[:&lt;port&gt;][:][/]&lt;path&gt;[#&lt;commit-ish&gt; | #semver:&lt;semver&gt;]</code></pre><p><code>&lt;protocol&gt;</code> is one of <code>git</code>, <code>git+ssh</code>, <code>git+http</code>, <code>git+https</code>, or
<code>git+file</code>.</p>
<p>If <code>#&lt;commit-ish&gt;</code> is provided, it will be used to clone exactly that
commit. If the commit-ish has the format <code>#semver:&lt;semver&gt;</code>, <code>&lt;semver&gt;</code> can
@ -370,11 +349,10 @@ or refs matching that range in the remote repository, much as it would for a
registry dependency. If neither <code>#&lt;commit-ish&gt;</code> or <code>#semver:&lt;semver&gt;</code> is
specified, then <code>master</code> is used.</p>
<p>Examples:</p>
<pre><code>git+ssh://git@github.com:npm/npm.git#v1.0.27
git+ssh://git@github.com:npm/npm#semver:^5.0
git+https://isaacs@github.com/npm/npm.git
git://github.com/npm/npm.git#v1.0.27
</code></pre><h3 id="github-urls">GitHub URLs</h3>
<pre><code>git+ssh://git@github.com:npm/cli.git#v1.0.27
git+ssh://git@github.com:npm/cli#semver:^5.0
git+https://isaacs@github.com/npm/cli.git
git://github.com/npm/cli.git#v1.0.27</code></pre><h3 id="github-urls">GitHub URLs</h3>
<p>As of version 1.1.65, you can refer to GitHub urls as just &quot;foo&quot;:
&quot;user/foo-project&quot;. Just as with git URLs, a <code>commit-ish</code> suffix can be
included. For example:</p>
@ -386,24 +364,21 @@ included. For example:</p>
&quot;mocha&quot;: &quot;mochajs/mocha#4727d357ea&quot;,
&quot;module&quot;: &quot;user/repo#feature\/branch&quot;
}
}
</code></pre><h3 id="local-paths">Local Paths</h3>
}</code></pre><h3 id="local-paths">Local Paths</h3>
<p>As of version 2.0.0 you can provide a path to a local directory that contains a
package. Local paths can be saved using <code>npm install -S</code> or
<code>npm install --save</code>, using any of these forms:</p>
<pre><code>../foo/bar
~/foo/bar
./foo/bar
/foo/bar
</code></pre><p>in which case they will be normalized to a relative path and added to your
/foo/bar</code></pre><p>in which case they will be normalized to a relative path and added to your
<code>package.json</code>. For example:</p>
<pre><code>{
&quot;name&quot;: &quot;baz&quot;,
&quot;dependencies&quot;: {
&quot;bar&quot;: &quot;file:../foo/bar&quot;
}
}
</code></pre><p>This feature is helpful for local offline development and creating
}</code></pre><p>This feature is helpful for local offline development and creating
tests that require npm installing where you don&#39;t want to hit an
external server, but should not be used when publishing packages
to the public registry.</p>
@ -430,8 +405,7 @@ script to do this, and make the required package a devDependency.</p>
&quot;prepare&quot;: &quot;coffee -o lib/ -c src/waza.coffee&quot;
},
&quot;main&quot;: &quot;lib/waza.js&quot;
}
</code></pre><p>The <code>prepare</code> script will be run before publishing, so that users
}</code></pre><p>The <code>prepare</code> script will be run before publishing, so that users
can consume the functionality without requiring them to compile it
themselves. In dev mode (ie, locally running <code>npm install</code>), it&#39;ll
run this script as well, so that you can test it easily.</p>
@ -447,13 +421,11 @@ a specific interface, expected and specified by the host documentation.</p>
&quot;peerDependencies&quot;: {
&quot;tea&quot;: &quot;2.x&quot;
}
}
</code></pre><p>This ensures your package <code>tea-latte</code> can be installed <em>along</em> with the second
}</code></pre><p>This ensures your package <code>tea-latte</code> can be installed <em>along</em> with the second
major version of the host package <code>tea</code> only. <code>npm install tea-latte</code> could
possibly yield the following dependency graph:</p>
<pre><code>├── tea-latte@1.3.5
└── tea@2.2.0
</code></pre><p><strong>NOTE: npm versions 1 and 2 will automatically install <code>peerDependencies</code> if
└── tea@2.2.0</code></pre><p><strong>NOTE: npm versions 1 and 2 will automatically install <code>peerDependencies</code> if
they are not explicitly depended upon higher in the dependency tree. In the
next major version of npm (npm@3), this will no longer be the case. You will
receive a warning that the peerDependency is not installed instead.</strong> The
@ -481,8 +453,7 @@ array and executing <code>npm pack</code>.</p>
&quot;bundledDependencies&quot;: [
&quot;renderized&quot;, &quot;super-streams&quot;
]
}
</code></pre><p>we can obtain <code>awesome-web-framework-1.0.0.tgz</code> file by running <code>npm pack</code>.
}</code></pre><p>we can obtain <code>awesome-web-framework-1.0.0.tgz</code> file by running <code>npm pack</code>.
This file contains the dependencies <code>renderized</code> and <code>super-streams</code> which
can be installed in a new project by executing <code>npm install
awesome-web-framework-1.0.0.tgz</code>.</p>
@ -509,21 +480,18 @@ if ( notGoodFooVersion(fooVersion) ) {
if (foo) {
foo.doFooThings()
}
</code></pre><p>Entries in <code>optionalDependencies</code> will override entries of the same name in
}</code></pre><p>Entries in <code>optionalDependencies</code> will override entries of the same name in
<code>dependencies</code>, so it&#39;s usually best to only put in one place.</p>
<h2 id="engines">engines</h2>
<p>You can specify the version of node that your stuff works on:</p>
<pre><code>{ &quot;engines&quot; : { &quot;node&quot; : &quot;&gt;=0.10.3 &lt;0.12&quot; } }
</code></pre><p>And, like with dependencies, if you don&#39;t specify the version (or if you
<pre><code>{ &quot;engines&quot; : { &quot;node&quot; : &quot;&gt;=0.10.3 &lt;0.12&quot; } }</code></pre><p>And, like with dependencies, if you don&#39;t specify the version (or if you
specify &quot;*&quot; as the version), then any version of node will do.</p>
<p>If you specify an &quot;engines&quot; field, then npm will require that &quot;node&quot; be
somewhere on that list. If &quot;engines&quot; is omitted, then npm will just assume
that it works on node.</p>
<p>You can also use the &quot;engines&quot; field to specify which versions of npm
are capable of properly installing your program. For example:</p>
<pre><code>{ &quot;engines&quot; : { &quot;npm&quot; : &quot;~1.0.20&quot; } }
</code></pre><p>Unless the user has set the <code>engine-strict</code> config flag, this
<pre><code>{ &quot;engines&quot; : { &quot;npm&quot; : &quot;~1.0.20&quot; } }</code></pre><p>Unless the user has set the <code>engine-strict</code> config flag, this
field is advisory only and will only produce warnings when your package is installed as a dependency.</p>
<h2 id="enginestrict">engineStrict</h2>
<p><strong>This feature was removed in npm 3.0.0</strong></p>
@ -532,20 +500,16 @@ user had set <code>engine-strict</code>. It is no longer used.</p>
<h2 id="os">os</h2>
<p>You can specify which operating systems your
module will run on:</p>
<pre><code>&quot;os&quot; : [ &quot;darwin&quot;, &quot;linux&quot; ]
</code></pre><p>You can also blacklist instead of whitelist operating systems,
<pre><code>&quot;os&quot; : [ &quot;darwin&quot;, &quot;linux&quot; ]</code></pre><p>You can also blacklist instead of whitelist operating systems,
just prepend the blacklisted os with a &#39;!&#39;:</p>
<pre><code>&quot;os&quot; : [ &quot;!win32&quot; ]
</code></pre><p>The host operating system is determined by <code>process.platform</code></p>
<pre><code>&quot;os&quot; : [ &quot;!win32&quot; ]</code></pre><p>The host operating system is determined by <code>process.platform</code></p>
<p>It is allowed to both blacklist, and whitelist, although there isn&#39;t any
good reason to do this.</p>
<h2 id="cpu">cpu</h2>
<p>If your code only runs on certain cpu architectures,
you can specify which ones.</p>
<pre><code>&quot;cpu&quot; : [ &quot;x64&quot;, &quot;ia32&quot; ]
</code></pre><p>Like the <code>os</code> option, you can also blacklist architectures:</p>
<pre><code>&quot;cpu&quot; : [ &quot;!arm&quot;, &quot;!mips&quot; ]
</code></pre><p>The host architecture is determined by <code>process.arch</code></p>
<pre><code>&quot;cpu&quot; : [ &quot;x64&quot;, &quot;ia32&quot; ]</code></pre><p>Like the <code>os</code> option, you can also blacklist architectures:</p>
<pre><code>&quot;cpu&quot; : [ &quot;!arm&quot;, &quot;!mips&quot; ]</code></pre><p>The host architecture is determined by <code>process.arch</code></p>
<h2 id="preferglobal">preferGlobal</h2>
<p><strong>DEPRECATED</strong></p>
<p>This option used to trigger an npm warning, but it will no longer warn. It is
@ -610,5 +574,5 @@ ignored.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">package.json &mdash; npm@6.1.0</p>
<p id="footer">package.json &mdash; npm@6.2.0</p>

View File

@ -180,5 +180,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-index &mdash; npm@6.1.0</p>
<p id="footer">npm-index &mdash; npm@6.2.0</p>

View File

@ -29,21 +29,17 @@ statements onto multiple lines.</p>
<p>Curly braces belong on the same line as the thing that necessitates them.</p>
<p>Bad:</p>
<pre><code>function ()
{
</code></pre><p>Good:</p>
<pre><code>function () {
</code></pre><p>If a block needs to wrap to the next line, use a curly brace. Don&#39;t
{</code></pre><p>Good:</p>
<pre><code>function () {</code></pre><p>If a block needs to wrap to the next line, use a curly brace. Don&#39;t
use it if it doesn&#39;t.</p>
<p>Bad:</p>
<pre><code>if (foo) { bar() }
while (foo)
bar()
</code></pre><p>Good:</p>
bar()</code></pre><p>Good:</p>
<pre><code>if (foo) bar()
while (foo) {
bar()
}
</code></pre><h2 id="semicolons">Semicolons</h2>
}</code></pre><h2 id="semicolons">Semicolons</h2>
<p>Don&#39;t use them except in four situations:</p>
<ul>
<li><code>for (;;)</code> loops. They&#39;re actually required.</li>
@ -64,8 +60,7 @@ for (var i = 0; i &lt; 10; i ++) {
default: throw new Error(&#39;unknown state&#39;)
}
end()
}
</code></pre><p>Note that starting lines with <code>-</code> and <code>+</code> also should be prefixed
}</code></pre><p>Note that starting lines with <code>-</code> and <code>+</code> also should be prefixed
with a semicolon, but this is much less common.</p>
<h2 id="comma-first">Comma First</h2>
<p>If there is a list of things separated by commas, and it wraps
@ -82,15 +77,12 @@ final token in the list on a line by itself. For example:</p>
, a = 1
, b = &#39;abc&#39;
, etc
, somethingElse
</code></pre><h2 id="quotes">Quotes</h2>
, somethingElse</code></pre><h2 id="quotes">Quotes</h2>
<p>Use single quotes for strings except to avoid escaping.</p>
<p>Bad:</p>
<pre><code>var notOk = &quot;Just double quotes&quot;
</code></pre><p>Good:</p>
<pre><code>var notOk = &quot;Just double quotes&quot;</code></pre><p>Good:</p>
<pre><code>var ok = &#39;String contains &quot;double&quot; quotes&#39;
var alsoOk = &quot;String contains &#39;single&#39; quotes or apostrophe&quot;
</code></pre><h2 id="whitespace">Whitespace</h2>
var alsoOk = &quot;String contains &#39;single&#39; quotes or apostrophe&quot;</code></pre><h2 id="whitespace">Whitespace</h2>
<p>Put a single space in front of <code>(</code> for anything other than a function call.
Also use a single space wherever it makes things more readable.</p>
<p>Don&#39;t leave trailing whitespace at the end of lines. Don&#39;t indent empty
@ -153,5 +145,5 @@ set to anything.&quot;</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-coding-style &mdash; npm@6.1.0</p>
<p id="footer">npm-coding-style &mdash; npm@6.2.0</p>

View File

@ -82,27 +82,22 @@ configuration parameter, then it is expanded to that configuration
parameter. For example:</p>
<pre><code>npm ls --par
# same as:
npm ls --parseable
</code></pre><p>If multiple single-character shorthands are strung together, and the
npm ls --parseable</code></pre><p>If multiple single-character shorthands are strung together, and the
resulting combination is unambiguously not some other configuration
param, then it is expanded to its various component pieces. For
example:</p>
<pre><code>npm ls -gpld
# same as:
npm ls --global --parseable --long --loglevel info
</code></pre><h2 id="per-package-config-settings">Per-Package Config Settings</h2>
npm ls --global --parseable --long --loglevel info</code></pre><h2 id="per-package-config-settings">Per-Package Config Settings</h2>
<p>When running scripts (see <code><a href="../misc/npm-scripts.html">npm-scripts(7)</a></code>) the package.json &quot;config&quot;
keys are overwritten in the environment if there is a config param of
<code>&lt;name&gt;[@&lt;version&gt;]:&lt;key&gt;</code>. For example, if the package.json has
this:</p>
<pre><code>{ &quot;name&quot; : &quot;foo&quot;
, &quot;config&quot; : { &quot;port&quot; : &quot;8080&quot; }
, &quot;scripts&quot; : { &quot;start&quot; : &quot;node server.js&quot; } }
</code></pre><p>and the server.js is this:</p>
<pre><code>http.createServer(...).listen(process.env.npm_package_config_port)
</code></pre><p>then the user could change the behavior by doing:</p>
<pre><code>npm config set foo:port 80
</code></pre><p>See <a href="../files/package.json.html">package.json(5)</a> for more information.</p>
, &quot;scripts&quot; : { &quot;start&quot; : &quot;node server.js&quot; } }</code></pre><p>and the server.js is this:</p>
<pre><code>http.createServer(...).listen(process.env.npm_package_config_port)</code></pre><p>then the user could change the behavior by doing:</p>
<pre><code>npm config set foo:port 80</code></pre><p>See <a href="../files/package.json.html">package.json(5)</a> for more information.</p>
<h2 id="config-settings">Config Settings</h2>
<h3 id="access">access</h3>
<ul>
@ -172,13 +167,11 @@ ostensibly Unix systems.</p>
<p>The Certificate Authority signing certificate that is trusted for SSL
connections to the registry. Values should be in PEM format (Windows calls it &quot;Base-64 encoded X.509 (.CER)&quot;) with newlines
replaced by the string &quot;\n&quot;. For example:</p>
<pre><code>ca=&quot;-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----&quot;
</code></pre><p>Set to <code>null</code> to only allow &quot;known&quot; registrars, or to a specific CA cert
<pre><code>ca=&quot;-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----&quot;</code></pre><p>Set to <code>null</code> to only allow &quot;known&quot; registrars, or to a specific CA cert
to trust only that specific signing authority.</p>
<p>Multiple CAs can be trusted by specifying an array of certificates:</p>
<pre><code>ca[]=&quot;...&quot;
ca[]=&quot;...&quot;
</code></pre><p>See also the <code>strict-ssl</code> config.</p>
ca[]=&quot;...&quot;</code></pre><p>See also the <code>strict-ssl</code> config.</p>
<h3 id="cafile">cafile</h3>
<ul>
<li>Default: <code>null</code></li>
@ -232,8 +225,7 @@ well as for the CA information to be stored in a file on disk.</p>
</ul>
<p>A client certificate to pass when accessing the registry. Values should be in
PEM format (Windows calls it &quot;Base-64 encoded X.509 (.CER)&quot;) with newlines replaced by the string &quot;\n&quot;. For example:</p>
<pre><code>cert=&quot;-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----&quot;
</code></pre><p>It is <em>not</em> the path to a certificate file (and there is no &quot;certfile&quot; option).</p>
<pre><code>cert=&quot;-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----&quot;</code></pre><p>It is <em>not</em> the path to a certificate file (and there is no &quot;certfile&quot; option).</p>
<h3 id="cidr">cidr</h3>
<ul>
<li>Default: <code>null</code></li>
@ -487,8 +479,7 @@ output from <code>npm ls --json</code> and <code>npm search --json</code> are cu
</ul>
<p>A client key to pass when accessing the registry. Values should be in PEM
format with newlines replaced by the string &quot;\n&quot;. For example:</p>
<pre><code>key=&quot;-----BEGIN PRIVATE KEY-----\nXXXX\nXXXX\n-----END PRIVATE KEY-----&quot;
</code></pre><p>It is <em>not</em> the path to a key file (and there is no &quot;keyfile&quot; option).</p>
<pre><code>key=&quot;-----BEGIN PRIVATE KEY-----\nXXXX\nXXXX\n-----END PRIVATE KEY-----&quot;</code></pre><p>It is <em>not</em> the path to a key file (and there is no &quot;keyfile&quot; option).</p>
<h3 id="legacy-bundling">legacy-bundling</h3>
<ul>
<li>Default: false</li>
@ -884,6 +875,15 @@ Windows</li>
<p>If set to false, then ignore <code>npm-shrinkwrap.json</code> files when installing. This
will also prevent <em>writing</em> <code>npm-shrinkwrap.json</code> if <code>save</code> is true.</p>
<p>This option is an alias for <code>--package-lock</code>.</p>
<h3 id="sign-git-commit">sign-git-commit</h3>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>If set to true, then the <code>npm version</code> command will commit the new package
version using <code>-S</code> to add a signature.</p>
<p>Note that git requires you to have set up GPG keys in your git configs
for this to work properly.</p>
<h3 id="sign-git-tag">sign-git-tag</h3>
<ul>
<li>Default: false</li>
@ -966,6 +966,13 @@ false, it uses ascii characters to draw trees.</p>
<p>Set to true to suppress the UID/GID switching when running package
scripts. If set explicitly to false, then installing as a non-root user
will fail.</p>
<h3 id="update-notifier">update-notifier</h3>
<ul>
<li>Default: true</li>
<li>Type: Boolean</li>
</ul>
<p>Set to false to suppress the update notification when using an older
version of npm than the latest.</p>
<h3 id="usage">usage</h3>
<ul>
<li>Default: false</li>
@ -1043,5 +1050,5 @@ exit successfully.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-config &mdash; npm@6.1.0</p>
<p id="footer">npm-config &mdash; npm@6.2.0</p>

View File

@ -39,8 +39,7 @@ after packing it up into a tarball (b).</p>
<pre><code>git://github.com/user/project.git#commit-ish
git+ssh://user@hostname:project.git#commit-ish
git+http://user@hostname/project/blah.git#commit-ish
git+https://user@hostname/project/blah.git#commit-ish
</code></pre><p>The <code>commit-ish</code> can be any tag, sha, or branch which can be supplied as
git+https://user@hostname/project/blah.git#commit-ish</code></pre><p>The <code>commit-ish</code> can be any tag, sha, or branch which can be supplied as
an argument to <code>git checkout</code>. The default is <code>master</code>.</p>
<h2 id="the-package-json-file">The package.json File</h2>
<p>You need to have a <code>package.json</code> file in the root of your project to do
@ -154,26 +153,21 @@ problems trying to publish it. Or, worse yet, you&#39;ll be able to
publish it, but you&#39;ll be publishing a broken or pointless package.
So don&#39;t do that.</p>
<p>In the root of your package, do this:</p>
<pre><code>npm install . -g
</code></pre><p>That&#39;ll show you that it&#39;s working. If you&#39;d rather just create a symlink
<pre><code>npm install . -g</code></pre><p>That&#39;ll show you that it&#39;s working. If you&#39;d rather just create a symlink
package that points to your working directory, then do this:</p>
<pre><code>npm link
</code></pre><p>Use <code>npm ls -g</code> to see if it&#39;s there.</p>
<pre><code>npm link</code></pre><p>Use <code>npm ls -g</code> to see if it&#39;s there.</p>
<p>To test a local install, go into some other folder, and then do:</p>
<pre><code>cd ../some-other-folder
npm install ../my-package
</code></pre><p>to install it locally into the node_modules folder in that other place.</p>
npm install ../my-package</code></pre><p>to install it locally into the node_modules folder in that other place.</p>
<p>Then go into the node-repl, and try using require(&quot;my-thing&quot;) to
bring in your module&#39;s main module.</p>
<h2 id="create-a-user-account">Create a User Account</h2>
<p>Create a user with the adduser command. It works like this:</p>
<pre><code>npm adduser
</code></pre><p>and then follow the prompts.</p>
<pre><code>npm adduser</code></pre><p>and then follow the prompts.</p>
<p>This is documented better in <a href="../cli/npm-adduser.html">npm-adduser(1)</a>.</p>
<h2 id="publish-your-package">Publish your package</h2>
<p>This part&#39;s easy. In the root of your folder, do this:</p>
<pre><code>npm publish
</code></pre><p>You can give publish a url to a tarball, or a filename of a tarball,
<pre><code>npm publish</code></pre><p>You can give publish a url to a tarball, or a filename of a tarball,
or a path to a folder.</p>
<p>Note that pretty much <strong>everything in that folder will be exposed</strong>
by default. So, if you have secret stuff in there, use a
@ -204,5 +198,5 @@ from a fresh checkout.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-developers &mdash; npm@6.1.0</p>
<p id="footer">npm-developers &mdash; npm@6.2.0</p>

View File

@ -20,7 +20,7 @@ Conduct.</p>
<h2 id="tl-dr">TL;DR</h2>
<ol>
<li>Get the author email with <code>npm owner ls &lt;pkgname&gt;</code></li>
<li>Email the author, CC <a href="mailto:&#115;&#x75;&#x70;&#112;&#111;&#x72;&#x74;&#x40;&#110;&#112;&#109;&#x6a;&#x73;&#46;&#99;&#x6f;&#x6d;">&#115;&#x75;&#x70;&#112;&#111;&#x72;&#x74;&#x40;&#110;&#112;&#109;&#x6a;&#x73;&#46;&#99;&#x6f;&#x6d;</a></li>
<li>Email the author, CC <a href="mailto:&#115;&#x75;&#112;&#x70;&#x6f;&#114;&#116;&#64;&#110;&#x70;&#x6d;&#106;&#115;&#46;&#99;&#x6f;&#x6d;">&#115;&#x75;&#112;&#x70;&#x6f;&#114;&#116;&#64;&#110;&#x70;&#x6d;&#106;&#115;&#46;&#99;&#x6f;&#x6d;</a></li>
<li>After a few weeks, if there&#39;s no resolution, we&#39;ll sort it out.</li>
</ol>
<p>Don&#39;t squat on package names. Publish code or move out of the way.</p>
@ -44,7 +44,7 @@ publishes it to the npm registry. Being a simple little thing, it never
really has to be updated. Alice works for Foo Inc, the makers of the
critically acclaimed and widely-marketed <code>foo</code> JavaScript toolkit framework.
They publish it to npm as <code>foojs</code>, but people are routinely confused when
<code>npm install</code>foo<code></code> is some different thing.</li>
<code>npm install foo</code> is some different thing.</li>
<li><p>Yusuf writes a parser for the widely-known <code>foo</code> file format, because he
needs it for work. Then, he gets a new job, and never updates the prototype.
Later on, Alice writes a much more complete <code>foo</code> parser, but can&#39;t publish,
@ -55,12 +55,12 @@ because Yusuf&#39;s <code>foo</code> is in the way.</p>
</li>
<li>Alice emails Yusuf, explaining the situation <strong>as respectfully as possible</strong>,
and what she would like to do with the module name. She adds the npm support
staff <a href="mailto:&#x73;&#117;&#112;&#x70;&#111;&#114;&#116;&#64;&#110;&#x70;&#109;&#x6a;&#115;&#x2e;&#99;&#111;&#109;">&#x73;&#117;&#112;&#x70;&#111;&#114;&#116;&#64;&#110;&#x70;&#109;&#x6a;&#115;&#x2e;&#99;&#111;&#109;</a> to the CC list of the email. Mention in the email
staff <a href="mailto:&#115;&#117;&#112;&#112;&#x6f;&#114;&#116;&#64;&#x6e;&#112;&#109;&#106;&#115;&#46;&#x63;&#111;&#x6d;">&#115;&#117;&#112;&#112;&#x6f;&#114;&#116;&#64;&#x6e;&#112;&#109;&#106;&#115;&#46;&#x63;&#111;&#x6d;</a> to the CC list of the email. Mention in the email
that Yusuf can run npm owner <code>add alice foo</code> to add Alice as an owner of the
foo package.</li>
<li>After a reasonable amount of time, if Yusuf has not responded, or if Yusuf
and Alice can&#39;t come to any sort of resolution, email support
<a href="mailto:&#x73;&#x75;&#112;&#x70;&#x6f;&#x72;&#x74;&#x40;&#110;&#112;&#x6d;&#x6a;&#x73;&#x2e;&#99;&#x6f;&#x6d;">&#x73;&#x75;&#112;&#x70;&#x6f;&#x72;&#x74;&#x40;&#110;&#112;&#x6d;&#x6a;&#x73;&#x2e;&#99;&#x6f;&#x6d;</a> and we&#39;ll sort it out. (&quot;Reasonable&quot; is usually at least
<a href="mailto:&#x73;&#117;&#x70;&#112;&#x6f;&#x72;&#116;&#64;&#x6e;&#x70;&#x6d;&#106;&#x73;&#46;&#x63;&#x6f;&#x6d;">&#x73;&#117;&#x70;&#112;&#x6f;&#x72;&#116;&#64;&#x6e;&#x70;&#x6d;&#106;&#x73;&#46;&#x63;&#x6f;&#x6d;</a> and we&#39;ll sort it out. (&quot;Reasonable&quot; is usually at least
4 weeks.)</li>
</ol>
<h2 id="reasoning">REASONING</h2>
@ -96,12 +96,12 @@ application database or otherwise putting non-packagey things into it.</li>
<a href="https://www.npmjs.com/policies/conduct">Code of Conduct</a> such as hateful
language, pornographic content, or harassment.</li>
</ol>
<p>If you see bad behavior like this, please report it to <a href="mailto:&#97;&#x62;&#x75;&#115;&#101;&#x40;&#x6e;&#112;&#x6d;&#x6a;&#115;&#x2e;&#x63;&#x6f;&#x6d;">&#97;&#x62;&#x75;&#115;&#101;&#x40;&#x6e;&#112;&#x6d;&#x6a;&#115;&#x2e;&#x63;&#x6f;&#x6d;</a> right
<p>If you see bad behavior like this, please report it to <a href="mailto:&#97;&#98;&#x75;&#115;&#101;&#64;&#110;&#112;&#x6d;&#106;&#115;&#x2e;&#99;&#111;&#x6d;">&#97;&#98;&#x75;&#115;&#101;&#64;&#110;&#112;&#x6d;&#106;&#115;&#x2e;&#99;&#111;&#x6d;</a> right
away. <strong>You are never expected to resolve abusive behavior on your own. We are
here to help.</strong></p>
<h2 id="trademarks">TRADEMARKS</h2>
<p>If you think another npm publisher is infringing your trademark, such as by
using a confusingly similar package name, email <a href="mailto:&#x61;&#98;&#x75;&#x73;&#x65;&#x40;&#x6e;&#112;&#x6d;&#x6a;&#x73;&#x2e;&#x63;&#111;&#109;">&#x61;&#98;&#x75;&#x73;&#x65;&#x40;&#x6e;&#112;&#x6d;&#x6a;&#x73;&#x2e;&#x63;&#111;&#109;</a> with a link to
using a confusingly similar package name, email <a href="mailto:&#97;&#x62;&#x75;&#115;&#x65;&#64;&#x6e;&#x70;&#x6d;&#106;&#x73;&#46;&#x63;&#x6f;&#109;">&#97;&#x62;&#x75;&#115;&#x65;&#64;&#x6e;&#x70;&#x6d;&#106;&#x73;&#46;&#x63;&#x6f;&#109;</a> with a link to
the package or user account on <a href="https://npmjs.com">https://npmjs.com</a>. Attach a
copy of your trademark registration certificate.</p>
<p>If we see that the package&#39;s publisher is intentionally misleading others by
@ -111,7 +111,7 @@ clear up any confusion with changes to their package&#39;s <code><a href="../../
metadata.</p>
<h2 id="changes">CHANGES</h2>
<p>This is a living document and may be updated from time to time. Please refer to
the <a href="https://github.com/npm/npm/commits/master/doc/misc/npm-disputes.md">git history for this document</a>
the <a href="https://github.com/npm/cli/commits/latest/doc/misc/npm-disputes.md">git history for this document</a>
to view the changes.</p>
<h2 id="license">LICENSE</h2>
<p>Copyright (C) npm, Inc., All rights reserved</p>
@ -134,5 +134,5 @@ License.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-disputes &mdash; npm@6.1.0</p>
<p id="footer">npm-disputes &mdash; npm@6.2.0</p>

View File

@ -180,5 +180,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-index &mdash; npm@6.1.0</p>
<p id="footer">npm-index &mdash; npm@6.2.0</p>

View File

@ -29,46 +29,37 @@
<ul>
<li>Check who youve added to your org:</li>
</ul>
<pre><code>npm team ls &lt;org&gt;:developers
</code></pre><ul>
<pre><code>npm team ls &lt;org&gt;:developers</code></pre><ul>
<li><p>Each org is automatically given a <code>developers</code> team, so you can see the whole list of team members in your org. This team automatically gets read-write access to all packages, but you can change that with the <code>access</code> command.</p>
</li>
<li><p>Create a new team:</p>
</li>
</ul>
<pre><code>npm team create &lt;org:team&gt;
</code></pre><ul>
<pre><code>npm team create &lt;org:team&gt;</code></pre><ul>
<li>Add members to that team:</li>
</ul>
<pre><code>npm team add &lt;org:team&gt; &lt;user&gt;
</code></pre><h2 id="publish-a-package-and-adjust-package-access">Publish a package and adjust package access</h2>
<pre><code>npm team add &lt;org:team&gt; &lt;user&gt;</code></pre><h2 id="publish-a-package-and-adjust-package-access">Publish a package and adjust package access</h2>
<ul>
<li>In package directory, run</li>
</ul>
<pre><code>npm init --scope=&lt;org&gt;
</code></pre><p>to scope it for your org &amp; publish as usual</p>
<pre><code>npm init --scope=&lt;org&gt;</code></pre><p>to scope it for your org &amp; publish as usual</p>
<ul>
<li>Grant access: </li>
</ul>
<pre><code>npm access grant &lt;read-only|read-write&gt; &lt;org:team&gt; [&lt;package&gt;]
</code></pre><ul>
<pre><code>npm access grant &lt;read-only|read-write&gt; &lt;org:team&gt; [&lt;package&gt;]</code></pre><ul>
<li>Revoke access:</li>
</ul>
<pre><code>npm access revoke &lt;org:team&gt; [&lt;package&gt;]
</code></pre><h2 id="monitor-your-package-access">Monitor your package access</h2>
<pre><code>npm access revoke &lt;org:team&gt; [&lt;package&gt;]</code></pre><h2 id="monitor-your-package-access">Monitor your package access</h2>
<ul>
<li>See what org packages a team member can access:</li>
</ul>
<pre><code>npm access ls-packages &lt;org&gt; &lt;user&gt;
</code></pre><ul>
<pre><code>npm access ls-packages &lt;org&gt; &lt;user&gt;</code></pre><ul>
<li>See packages available to a specific team:</li>
</ul>
<pre><code>npm access ls-packages &lt;org:team&gt;
</code></pre><ul>
<pre><code>npm access ls-packages &lt;org:team&gt;</code></pre><ul>
<li>Check which teams are collaborating on a package:</li>
</ul>
<pre><code>npm access ls-collaborators &lt;pkg&gt;
</code></pre><h2 id="see-also">SEE ALSO</h2>
<pre><code>npm access ls-collaborators &lt;pkg&gt;</code></pre><h2 id="see-also">SEE ALSO</h2>
<ul>
<li><a href="../cli/npm-team.html">npm-team(1)</a></li>
<li><a href="../cli/npm-access.html">npm-access(1)</a></li>
@ -86,5 +77,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-orgs &mdash; npm@6.1.0</p>
<p id="footer">npm-orgs &mdash; npm@6.2.0</p>

View File

@ -43,8 +43,8 @@ interesting.
This is used to gather better metrics on how npm is used by humans, versus
build farms.</li>
</ul>
<p>The npm registry does not to correlate the information in these headers with
any authenticated accounts that may be used in the same requests.</p>
<p>The npm registry does not try to correlate the information in these headers
with any authenticated accounts that may be used in the same requests.</p>
<h2 id="can-i-run-my-own-private-registry-">Can I run my own private registry?</h2>
<p>Yes!</p>
<p>The easiest way is to replicate the couch database, and use the same (or
@ -90,5 +90,5 @@ effectively implement the entire CouchDB API anyway.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-registry &mdash; npm@6.1.0</p>
<p id="footer">npm-registry &mdash; npm@6.2.0</p>

View File

@ -15,8 +15,7 @@
follows the usual rules for package names (URL-safe characters, no leading dots
or underscores). When used in package names, scopes are preceded by an <code>@</code> symbol
and followed by a slash, e.g.</p>
<pre><code>@somescope/somepackagename
</code></pre><p>Scopes are a way of grouping related packages together, and also affect a few
<pre><code>@somescope/somepackagename</code></pre><p>Scopes are a way of grouping related packages together, and also affect a few
things about the way npm treats the package.</p>
<p>Each npm user/organization has their own scope, and only you can add packages
in your scope. This means you don&#39;t have to worry about someone taking your
@ -34,18 +33,15 @@ folder (<code>@myorg</code>) is simply the name of the scope preceded by an <cod
contain any number of scoped packages.</p>
<p>A scoped package is installed by referencing it by name, preceded by an
<code>@</code> symbol, in <code>npm install</code>:</p>
<pre><code>npm install @myorg/mypackage
</code></pre><p>Or in <code>package.json</code>:</p>
<pre><code>npm install @myorg/mypackage</code></pre><p>Or in <code>package.json</code>:</p>
<pre><code>&quot;dependencies&quot;: {
&quot;@myorg/mypackage&quot;: &quot;^1.3.0&quot;
}
</code></pre><p>Note that if the <code>@</code> symbol is omitted, in either case, npm will instead attempt to
}</code></pre><p>Note that if the <code>@</code> symbol is omitted, in either case, npm will instead attempt to
install from GitHub; see <code><a href="../cli/npm-install.html">npm-install(1)</a></code>.</p>
<h2 id="requiring-scoped-packages">Requiring scoped packages</h2>
<p>Because scoped packages are installed into a scope folder, you have to
include the name of the scope when requiring them in your code, e.g.</p>
<pre><code>require(&#39;@myorg/mypackage&#39;)
</code></pre><p>There is nothing special about the way Node treats scope folders. This
<pre><code>require(&#39;@myorg/mypackage&#39;)</code></pre><p>There is nothing special about the way Node treats scope folders. This
simply requires the <code>mypackage</code> module in the folder named <code>@myorg</code>.</p>
<h2 id="publishing-scoped-packages">Publishing scoped packages</h2>
<p>Scoped packages can be published from the CLI as of <code>npm@2</code> and can be
@ -71,12 +67,10 @@ desired, with <code>npm access</code> or on the npmjs.com website.</p>
seamlessly use a mix of packages from the primary npm registry and one or more
private registries, such as npm Enterprise.</p>
<p>You can associate a scope with a registry at login, e.g.</p>
<pre><code>npm login --registry=http://reg.example.com --scope=@myco
</code></pre><p>Scopes have a many-to-one relationship with registries: one registry can
<pre><code>npm login --registry=http://reg.example.com --scope=@myco</code></pre><p>Scopes have a many-to-one relationship with registries: one registry can
host multiple scopes, but a scope only ever points to one registry.</p>
<p>You can also associate a scope with a registry using <code>npm config</code>:</p>
<pre><code>npm config set @myco:registry http://reg.example.com
</code></pre><p>Once a scope is associated with a registry, any <code>npm install</code> for a package
<pre><code>npm config set @myco:registry http://reg.example.com</code></pre><p>Once a scope is associated with a registry, any <code>npm install</code> for a package
with that scope will request packages from that registry instead. Any
<code>npm publish</code> for a package name that contains the scope will be published to
that registry instead.</p>
@ -99,5 +93,5 @@ that registry instead.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-scope &mdash; npm@6.1.0</p>
<p id="footer">npm-scope &mdash; npm@6.2.0</p>

View File

@ -60,11 +60,11 @@ Run by the <code>npm shrinkwrap</code> command.</li>
<p>Additionally, arbitrary scripts can be executed by running <code>npm
run-script &lt;stage&gt;</code>. <em>Pre</em> and <em>post</em> commands with matching
names will be run for those as well (e.g. <code>premyscript</code>, <code>myscript</code>,
<code>postmyscript</code>). Scripts from dependencies can be run with `npm explore</p>
<p><pkg> -- npm run <stage>`.</p>
<code>postmyscript</code>). Scripts from dependencies can be run with <code>npm explore
&lt;pkg&gt; -- npm run &lt;stage&gt;</code>.</p>
<h2 id="prepublish-and-prepare">PREPUBLISH AND PREPARE</h2>
<h3 id="deprecation-note">DEPRECATION NOTE</h3>
<p>Since <a href="mailto:`npm@1.1.71">`npm@1.1.71</a><code>, the npm CLI has run the</code>prepublish<code>script for both</code>npm
<p>Since <a href="mailto:%60npm@1.1.71">`npm@1.1.71</a><code>, the npm CLI has run the</code>prepublish<code>script for both</code>npm
publish<code>and</code>npm install<code>, because it&#39;s a convenient way to prepare a package
for use (some common use cases are described in the section below). It has
also turned out to be, in practice, [very
@ -125,8 +125,7 @@ suites, then those executables will be added to the <code>PATH</code> for
executing the scripts. So, if your package.json has this:</p>
<pre><code>{ &quot;name&quot; : &quot;foo&quot;
, &quot;dependencies&quot; : { &quot;bar&quot; : &quot;0.1.x&quot; }
, &quot;scripts&quot;: { &quot;start&quot; : &quot;bar ./test&quot; } }
</code></pre><p>then you could run <code>npm start</code> to execute the <code>bar</code> script, which is
, &quot;scripts&quot;: { &quot;start&quot; : &quot;bar ./test&quot; } }</code></pre><p>then you could run <code>npm start</code> to execute the <code>bar</code> script, which is
exported into the <code>node_modules/.bin</code> directory on <code>npm install</code>.</p>
<h3 id="package-json-vars">package.json vars</h3>
<p>The package.json fields are tacked onto the <code>npm_package_</code> prefix. So,
@ -144,12 +143,9 @@ there is a config param of <code>&lt;name&gt;[@&lt;version&gt;]:&lt;key&gt;</cod
if the package.json has this:</p>
<pre><code>{ &quot;name&quot; : &quot;foo&quot;
, &quot;config&quot; : { &quot;port&quot; : &quot;8080&quot; }
, &quot;scripts&quot; : { &quot;start&quot; : &quot;node server.js&quot; } }
</code></pre><p>and the server.js is this:</p>
<pre><code>http.createServer(...).listen(process.env.npm_package_config_port)
</code></pre><p>then the user could change the behavior by doing:</p>
<pre><code>npm config set foo:port 80
</code></pre><h3 id="current-lifecycle-event">current lifecycle event</h3>
, &quot;scripts&quot; : { &quot;start&quot; : &quot;node server.js&quot; } }</code></pre><p>and the server.js is this:</p>
<pre><code>http.createServer(...).listen(process.env.npm_package_config_port)</code></pre><p>then the user could change the behavior by doing:</p>
<pre><code>npm config set foo:port 80</code></pre><h3 id="current-lifecycle-event">current lifecycle event</h3>
<p>Lastly, the <code>npm_lifecycle_event</code> environment variable is set to
whichever stage of the cycle is being executed. So, you could have a
single script used for different parts of the process which switches
@ -157,16 +153,14 @@ based on what&#39;s currently happening.</p>
<p>Objects are flattened following this format, so if you had
<code>{&quot;scripts&quot;:{&quot;install&quot;:&quot;foo.js&quot;}}</code> in your package.json, then you&#39;d
see this in the script:</p>
<pre><code>process.env.npm_package_scripts_install === &quot;foo.js&quot;
</code></pre><h2 id="examples">EXAMPLES</h2>
<pre><code>process.env.npm_package_scripts_install === &quot;foo.js&quot;</code></pre><h2 id="examples">EXAMPLES</h2>
<p>For example, if your package.json contains this:</p>
<pre><code>{ &quot;scripts&quot; :
{ &quot;install&quot; : &quot;scripts/install.js&quot;
, &quot;postinstall&quot; : &quot;scripts/install.js&quot;
, &quot;uninstall&quot; : &quot;scripts/uninstall.js&quot;
}
}
</code></pre><p>then <code>scripts/install.js</code> will be called for the install
}</code></pre><p>then <code>scripts/install.js</code> will be called for the install
and post-install stages of the lifecycle, and <code>scripts/uninstall.js</code>
will be called when the package is uninstalled. Since
<code>scripts/install.js</code> is running for two different phases, it would
@ -179,8 +173,7 @@ fine:</p>
, &quot;install&quot; : &quot;make &amp;&amp; make install&quot;
, &quot;test&quot; : &quot;make test&quot;
}
}
</code></pre><h2 id="exiting">EXITING</h2>
}</code></pre><h2 id="exiting">EXITING</h2>
<p>Scripts are run by passing the line as a script argument to <code>sh</code>.</p>
<p>If the script exits with a code other than 0, then this will abort the
process.</p>
@ -239,5 +232,5 @@ scripts is for compilation which must be done on the target architecture.</li>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-scripts &mdash; npm@6.1.0</p>
<p id="footer">npm-scripts &mdash; npm@6.2.0</p>

View File

@ -12,10 +12,8 @@
<h1><a href="../cli/npm-removal.html">npm-removal</a></h1> <p>Cleaning the Slate</p>
<h2 id="synopsis">SYNOPSIS</h2>
<p>So sad to see you go.</p>
<pre><code>sudo npm uninstall npm -g
</code></pre><p>Or, if that fails, get the npm source code, and do:</p>
<pre><code>sudo make uninstall
</code></pre><h2 id="more-severe-uninstalling">More Severe Uninstalling</h2>
<pre><code>sudo npm uninstall npm -g</code></pre><p>Or, if that fails, get the npm source code, and do:</p>
<pre><code>sudo make uninstall</code></pre><h2 id="more-severe-uninstalling">More Severe Uninstalling</h2>
<p>Usually, the above instructions are sufficient. That will remove
npm, but leave behind anything you&#39;ve installed.</p>
<p>If that doesn&#39;t work, or if you require more drastic measures,
@ -29,16 +27,13 @@ you configured node with a different <code>--prefix</code>, or installed npm wit
different prefix setting, then adjust the paths accordingly, replacing
<code>/usr/local</code> with your install prefix.</p>
<p>To remove everything npm-related manually:</p>
<pre><code>rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/npm*
</code></pre><p>If you installed things <em>with</em> npm, then your best bet is to uninstall
<pre><code>rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/npm*</code></pre><p>If you installed things <em>with</em> npm, then your best bet is to uninstall
them with npm first, and then install them again once you have a
proper install. This can help find any symlinks that are lying
around:</p>
<pre><code>ls -laF /usr/local/{lib/node{,/.npm},bin,share/man} | grep npm
</code></pre><p>Prior to version 0.3, npm used shim files for executables and node
<pre><code>ls -laF /usr/local/{lib/node{,/.npm},bin,share/man} | grep npm</code></pre><p>Prior to version 0.3, npm used shim files for executables and node
modules. To track those down, you can do the following:</p>
<pre><code>find /usr/local/{lib/node,bin} -exec grep -l npm \{\} \; ;
</code></pre><p>(This is also in the <a href="../../doc/README.html">README</a> file.)</p>
<pre><code>find /usr/local/{lib/node,bin} -exec grep -l npm \{\} \; ;</code></pre><p>(This is also in the <a href="../../doc/README.html">README</a> file.)</p>
<h2 id="see-also">SEE ALSO</h2>
<ul>
<li><a href="../../doc/README.html">README</a></li>
@ -57,5 +52,5 @@ modules. To track those down, you can do the following:</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">removing-npm &mdash; npm@6.1.0</p>
<p id="footer">removing-npm &mdash; npm@6.2.0</p>

View File

@ -11,12 +11,11 @@
<h1><a href="../misc/semver.html">semver</a></h1> <p>The semantic versioner for npm</p>
<h2 id="install">Install</h2>
<pre><code class="lang-bash">npm install --save semver
`
</code></pre>
<pre><code class="language-bash">npm install --save semver
`</code></pre>
<h2 id="usage">Usage</h2>
<p>As a node module:</p>
<pre><code class="lang-js">const semver = require(&#39;semver&#39;)
<pre><code class="language-js">const semver = require(&#39;semver&#39;)
semver.valid(&#39;1.2.3&#39;) // &#39;1.2.3&#39;
semver.valid(&#39;a.b.c&#39;) // null
@ -25,8 +24,7 @@ semver.satisfies(&#39;1.2.3&#39;, &#39;1.x || &gt;=2.5.0 || 5.0.0 - 7.2.3&#39;)
semver.gt(&#39;1.2.3&#39;, &#39;9.8.7&#39;) // false
semver.lt(&#39;1.2.3&#39;, &#39;9.8.7&#39;) // true
semver.valid(semver.coerce(&#39;v2&#39;)) // &#39;2.0.0&#39;
semver.valid(semver.coerce(&#39;42.6.7.9.3-alpha&#39;)) // &#39;42.6.7&#39;
</code></pre>
semver.valid(semver.coerce(&#39;42.6.7.9.3-alpha&#39;)) // &#39;42.6.7&#39;</code></pre>
<p>As a command-line utility:</p>
<pre><code>$ semver -h
@ -65,8 +63,7 @@ all supplied ranges, and prints all satisfying versions.
If no satisfying versions are found, then exits failure.
Versions are printed in ascending order, so supplying
multiple versions to the utility will just sort them.
</code></pre><h2 id="versions">Versions</h2>
multiple versions to the utility will just sort them.</code></pre><h2 id="versions">Versions</h2>
<p>A &quot;version&quot; is described by the <code>v2.0.0</code> specification found at
<a href="http://semver.org/">http://semver.org/</a>.</p>
<p>A leading <code>&quot;=&quot;</code> or <code>&quot;v&quot;</code> character is stripped off and ignored.</p>
@ -123,17 +120,14 @@ similar risk on the <em>next</em> set of prerelease versions.</p>
<h4 id="prerelease-identifiers">Prerelease Identifiers</h4>
<p>The method <code>.inc</code> takes an additional <code>identifier</code> string argument that
will append the value of the string as a prerelease identifier:</p>
<pre><code class="lang-javascript">semver.inc(&#39;1.2.3&#39;, &#39;prerelease&#39;, &#39;beta&#39;)
// &#39;1.2.4-beta.0&#39;
</code></pre>
<pre><code class="language-javascript">semver.inc(&#39;1.2.3&#39;, &#39;prerelease&#39;, &#39;beta&#39;)
// &#39;1.2.4-beta.0&#39;</code></pre>
<p>command-line example:</p>
<pre><code class="lang-bash">$ semver 1.2.3 -i prerelease --preid beta
1.2.4-beta.0
</code></pre>
<pre><code class="language-bash">$ semver 1.2.3 -i prerelease --preid beta
1.2.4-beta.0</code></pre>
<p>Which then can be used to increment further:</p>
<pre><code class="lang-bash">$ semver 1.2.4-beta.0 -i prerelease
1.2.4-beta.1
</code></pre>
<pre><code class="language-bash">$ semver 1.2.4-beta.0 -i prerelease
1.2.4-beta.1</code></pre>
<h3 id="advanced-range-syntax">Advanced Range Syntax</h3>
<p>Advanced range syntax desugars to primitive comparators in
deterministic ways.</p>
@ -231,7 +225,7 @@ zero.</p>
<h3 id="range-grammar">Range Grammar</h3>
<p>Putting all this together, here is a Backus-Naur grammar for ranges,
for the benefit of parser authors:</p>
<pre><code class="lang-bnf">range-set ::= range ( logical-or range ) *
<pre><code class="language-bnf">range-set ::= range ( logical-or range ) *
logical-or ::= ( &#39; &#39; ) * &#39;||&#39; ( &#39; &#39; ) *
range ::= hyphen | simple ( &#39; &#39; simple ) * | &#39;&#39;
hyphen ::= partial &#39; - &#39; partial
@ -246,8 +240,7 @@ qualifier ::= ( &#39;-&#39; pre )? ( &#39;+&#39; build )?
pre ::= parts
build ::= parts
parts ::= part ( &#39;.&#39; part ) *
part ::= nr | [-0-9A-Za-z]+
</code></pre>
part ::= nr | [-0-9A-Za-z]+</code></pre>
<h2 id="functions">Functions</h2>
<p>All methods and classes take a final <code>loose</code> boolean argument that, if
true, will be more forgiving about not-quite-valid semver strings.
@ -357,5 +350,5 @@ higher value components are invalid (<code>9999999999999999.4.7.4</code> is like
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">semver &mdash; npm@6.1.0</p>
<p id="footer">semver &mdash; npm@6.2.0</p>

22
deps/npm/lib/audit.js vendored
View File

@ -16,9 +16,13 @@ const readFile = Bluebird.promisify(fs.readFile)
module.exports = auditCmd
auditCmd.usage =
'npm audit\n' +
'npm audit fix\n'
const usage = require('./utils/usage')
auditCmd.usage = usage(
'audit',
'\nnpm audit [--json]' +
'\nnpm audit fix ' +
'[--force|--package-lock-only|--dry-run|--production|--only=(dev|prod)]'
)
auditCmd.completion = function (opts, cb) {
const argv = opts.conf.argv.remain
@ -100,7 +104,7 @@ function maybeReadFile (name) {
}
})
.catch({code: 'ENOENT'}, () => null)
.catch(ex => {
.catch((ex) => {
ex.file = file
throw ex
})
@ -152,7 +156,7 @@ function auditCmd (args, cb) {
(pkgJson && pkgJson.dependencies) || {},
(pkgJson && pkgJson.devDependencies) || {}
)
return lockVerify(npm.prefix).then(result => {
return lockVerify(npm.prefix).then((result) => {
if (result.status) return audit.generate(sw, requires)
const lockFile = shrinkwrap ? 'npm-shrinkwrap.json' : 'package-lock.json'
@ -163,7 +167,7 @@ function auditCmd (args, cb) {
})
}).then((auditReport) => {
return audit.submitForFullReport(auditReport)
}).catch(err => {
}).catch((err) => {
if (err.statusCode === 404 || err.statusCode >= 500) {
const ne = new Error(`Your configured registry (${npm.config.get('registry')}) does not support audit requests.`)
ne.code = 'ENOAUDIT'
@ -258,7 +262,11 @@ function auditCmd (args, cb) {
auditResult.metadata.vulnerabilities.high +
auditResult.metadata.vulnerabilities.critical
if (vulns > 0) process.exitCode = 1
return audit.printFullReport(auditResult)
if (npm.config.get('parseable')) {
return audit.printParseableReport(auditResult)
} else {
return audit.printFullReport(auditResult)
}
}
}).asCallback(cb)
}

View File

@ -69,7 +69,7 @@ function clean (args) {
}
const cachePath = path.join(npm.cache, '_cacache')
if (!npm.config.get('force')) {
return BB.reject(new Error("As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead.\n\nIf you're sure you want to delete the entire cache, rerun this command with --force."))
return BB.reject(new Error("As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead. On the other hand, if you're debugging an issue with the installer, you can use `npm install --cache /tmp/empty-cache` to use a temporary cache instead of nuking the actual one.\n\nIf you're sure you want to delete the entire cache, rerun this command with --force."))
}
// TODO - remove specific packages or package versions
return rm(cachePath)

View File

@ -220,6 +220,7 @@ Object.defineProperty(exports, 'defaults', {get: function () {
'send-metrics': false,
shell: osenv.shell(),
shrinkwrap: true,
'sign-git-commit': false,
'sign-git-tag': false,
'sso-poll-frequency': 500,
'sso-type': 'oauth',
@ -234,6 +235,7 @@ Object.defineProperty(exports, 'defaults', {get: function () {
!(process.getuid && process.setuid &&
process.getgid && process.setgid) ||
process.getuid() !== 0,
'update-notifier': true,
usage: false,
user: process.platform === 'win32' ? 0 : 'nobody',
userconfig: path.resolve(home, '.npmrc'),
@ -351,6 +353,7 @@ exports.types = {
'send-metrics': Boolean,
shell: String,
shrinkwrap: Boolean,
'sign-git-commit': Boolean,
'sign-git-tag': Boolean,
'sso-poll-frequency': Number,
'sso-type': [null, 'oauth', 'saml'],
@ -360,6 +363,7 @@ exports.types = {
tmp: path,
unicode: Boolean,
'unsafe-perm': Boolean,
'update-notifier': Boolean,
usage: Boolean,
user: [Number, String],
userconfig: path,

Some files were not shown because too many files have changed in this diff Show More