diff --git a/deps/npm/docs/content/commands/npm-cache.md b/deps/npm/docs/content/commands/npm-cache.md
index 091e26e8a71828..b5eddd46c05a7d 100644
--- a/deps/npm/docs/content/commands/npm-cache.md
+++ b/deps/npm/docs/content/commands/npm-cache.md
@@ -11,11 +11,7 @@ description: Manipulates packages cache
```bash
-npm cache add
-npm cache add
-npm cache add
-npm cache add
-npm cache add @
+npm cache add
npm cache clean []
npm cache ls [@]
npm cache verify
@@ -101,6 +97,7 @@ cache`](/commands/npm-cache)
### See Also
+* [package spec](/using-npm/package-spec)
* [npm folders](/configuring-npm/folders)
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
diff --git a/deps/npm/docs/content/commands/npm-ci.md b/deps/npm/docs/content/commands/npm-ci.md
index 3374bf1e25136b..9b8238d05a3b91 100644
--- a/deps/npm/docs/content/commands/npm-ci.md
+++ b/deps/npm/docs/content/commands/npm-ci.md
@@ -133,7 +133,7 @@ will *not* run any pre- or post-scripts.
* Type: null or String
The shell to use for scripts run with the `npm exec`, `npm run` and `npm
-init ` commands.
+init ` commands.
diff --git a/deps/npm/docs/content/commands/npm-deprecate.md b/deps/npm/docs/content/commands/npm-deprecate.md
index 4345120d3744b3..20f65140fc735f 100644
--- a/deps/npm/docs/content/commands/npm-deprecate.md
+++ b/deps/npm/docs/content/commands/npm-deprecate.md
@@ -11,7 +11,7 @@ description: Deprecate a version of a package
```bash
-npm deprecate [@]
+npm deprecate
```
@@ -45,8 +45,8 @@ In this case, a version `my-thing@1.0.0-beta.0` will also be deprecated.
You must be the package owner to deprecate something. See the `owner` and
`adduser` help topics.
-To un-deprecate a package, specify an empty string (`""`) for the `message`
-argument. Note that you must use double quotes with no space between them to
+To un-deprecate a package, specify an empty string (`""`) for the `message`
+argument. Note that you must use double quotes with no space between them to
format an empty string.
### Configuration
@@ -82,6 +82,7 @@ password, npm will prompt on the command line for one.
### See Also
+* [package spec](/using-npm/package-spec)
* [npm publish](/commands/npm-publish)
* [npm registry](/using-npm/registry)
* [npm owner](/commands/npm-owner)
diff --git a/deps/npm/docs/content/commands/npm-dist-tag.md b/deps/npm/docs/content/commands/npm-dist-tag.md
index b9caf1fbe7fa9c..123e67dbf3b235 100644
--- a/deps/npm/docs/content/commands/npm-dist-tag.md
+++ b/deps/npm/docs/content/commands/npm-dist-tag.md
@@ -11,9 +11,9 @@ description: Modify package distribution tags
```bash
-npm dist-tag add @ []
-npm dist-tag rm
-npm dist-tag ls []
+npm dist-tag add []
+npm dist-tag rm
+npm dist-tag ls []
alias: dist-tags
```
@@ -27,11 +27,11 @@ alias: dist-tags
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. If you have two-factor
- authentication on auth-and-writes then you’ll need to include a one-time
- password on the command line with `--otp `, or at the
- OTP prompt.
+* add: Tags the specified version of the package with the specified tag,
+ or the `--tag` config if not specified. If you have two-factor
+ authentication on auth-and-writes then you’ll need to include a
+ one-time password on the command line with
+ `--otp `, or at the OTP prompt.
* rm: Clear a tag that is no longer in use from the package. If you have
two-factor authentication on auth-and-writes then you’ll need to include
@@ -168,6 +168,7 @@ This value is not exported to the environment for child processes.
### See Also
+* [package spec](/using-npm/package-spec)
* [npm publish](/commands/npm-publish)
* [npm install](/commands/npm-install)
* [npm dedupe](/commands/npm-dedupe)
diff --git a/deps/npm/docs/content/commands/npm-explain.md b/deps/npm/docs/content/commands/npm-explain.md
index 765221056585d9..5ba2fe8206ba16 100644
--- a/deps/npm/docs/content/commands/npm-explain.md
+++ b/deps/npm/docs/content/commands/npm-explain.md
@@ -11,7 +11,7 @@ description: Explain installed packages
```bash
-npm explain
+npm explain
alias: why
```
@@ -26,9 +26,10 @@ alias: why
This command will print the chain of dependencies causing a given package
to be installed in the current project.
-Positional arguments can be either folders within `node_modules`, or
-`name@version-range` specifiers, which will select the dependency
-relationships to explain.
+If one or more package specs are provided, then only packages matching
+one of the specifiers will have their relationships explained.
+
+The package spec can also refer to a folder within `./node_modules`
For example, running `npm explain glob` within npm's source tree will show:
@@ -110,6 +111,7 @@ This value is not exported to the environment for child processes.
### See Also
+* [package spec](/using-npm/package-spec)
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [npm folders](/configuring-npm/folders)
diff --git a/deps/npm/docs/content/commands/npm-fund.md b/deps/npm/docs/content/commands/npm-fund.md
index 5b96e91ab8ccb9..8db0ce910de967 100644
--- a/deps/npm/docs/content/commands/npm-fund.md
+++ b/deps/npm/docs/content/commands/npm-fund.md
@@ -11,7 +11,7 @@ description: Retrieve funding information
```bash
-npm fund [[<@scope>/]]
+npm fund []
```
@@ -23,22 +23,22 @@ npm fund [[<@scope>/]]
This command retrieves information on how to fund the dependencies of a
given project. If no package name is provided, it will list all
-dependencies that are looking for funding in a tree structure, listing the
-type of funding and the url to visit. If a package name is provided then it
-tries to open its funding url using the `--browser` config param; if there
-are multiple funding sources for the package, the user will be instructed
-to pass the `--which` option to disambiguate.
+dependencies that are looking for funding in a tree structure, listing
+the type of funding and the url to visit. If a package name is provided
+then it tries to open its funding url using the `--browser` config
+param; if there are multiple funding sources for the package, the user
+will be instructed to pass the `--which` option to disambiguate.
The list will avoid duplicated entries and will stack all packages that
-share the same url as a single entry. Thus, the list does not have the same
-shape of the output from `npm ls`.
+share the same url as a single entry. Thus, the list does not have the
+same shape of the output from `npm ls`.
#### Example
### Workspaces support
-It's possible to filter the results to only include a single workspace and its
-dependencies using the `workspace` config option.
+It's possible to filter the results to only include a single workspace
+and its dependencies using the `workspace` config option.
#### Example:
@@ -58,8 +58,8 @@ test-workspaces-fund@1.0.0
`-- bar@2.0.0
```
-And here is an example of the expected result when filtering only by
-a specific workspace `a` in the same project:
+And here is an example of the expected result when filtering only by a
+specific workspace `a` in the same project:
```bash
$ npm fund -w a
@@ -156,6 +156,7 @@ If there are multiple funding sources, which 1-indexed source URL to open.
## See Also
+* [package spec](/using-npm/package-spec)
* [npm install](/commands/npm-install)
* [npm docs](/commands/npm-docs)
* [npm ls](/commands/npm-ls)
diff --git a/deps/npm/docs/content/commands/npm-init.md b/deps/npm/docs/content/commands/npm-init.md
index 35343cceb4aa13..cd0be4643e0ead 100644
--- a/deps/npm/docs/content/commands/npm-init.md
+++ b/deps/npm/docs/content/commands/npm-init.md
@@ -11,9 +11,8 @@ description: Create a package.json file
```bash
-npm init [--force|-f|--yes|-y|--scope]
+npm init (same as `npx )
npm init <@scope> (same as `npx <@scope>/create`)
-npm init [<@scope>/] (same as `npx [<@scope>/]create-`)
aliases: create, innit
```
@@ -204,6 +203,39 @@ mistakes, unnecessary performance degradation, and malicious input.
If you don't have a clear idea of what you want to do, it is strongly
recommended that you do not use this option!
+
+
+
+#### `scope`
+
+* Default: the scope of the current project, if any, or ""
+* Type: String
+
+Associate an operation with a scope for a scoped registry.
+
+Useful when logging in to or out of a private registry:
+
+```
+# log in, linking the scope to the custom registry
+npm login --scope=@mycorp --registry=https://registry.mycorp.com
+
+# log out, removing the link and the auth token
+npm logout --scope=@mycorp
+```
+
+This will cause `@mycorp` to be mapped to the registry for future
+installation of packages specified according to the pattern
+`@mycorp/package`.
+
+This will also cause `npm init` to create a scoped package.
+
+```
+# accept all defaults, and create a package named "@foo/whatever",
+# instead of just named "whatever"
+npm init --scope=@foo --yes
+```
+
+
@@ -284,6 +316,7 @@ This value is not exported to the environment for child processes.
### See Also
+* [package spec](/using-npm/package-spec)
* [init-package-json module](http://npm.im/init-package-json)
* [package.json](/configuring-npm/package-json)
* [npm version](/commands/npm-version)
diff --git a/deps/npm/docs/content/commands/npm-install-ci-test.md b/deps/npm/docs/content/commands/npm-install-ci-test.md
index 0d9470acf58b3d..74ed4667e81bfe 100644
--- a/deps/npm/docs/content/commands/npm-install-ci-test.md
+++ b/deps/npm/docs/content/commands/npm-install-ci-test.md
@@ -79,7 +79,7 @@ will *not* run any pre- or post-scripts.
* Type: null or String
The shell to use for scripts run with the `npm exec`, `npm run` and `npm
-init ` commands.
+init ` commands.
diff --git a/deps/npm/docs/content/commands/npm-install-test.md b/deps/npm/docs/content/commands/npm-install-test.md
index 3dd860ea5c6f68..d27686e731ce16 100644
--- a/deps/npm/docs/content/commands/npm-install-test.md
+++ b/deps/npm/docs/content/commands/npm-install-test.md
@@ -11,16 +11,7 @@ description: Install package(s) and run tests
```bash
-npm install-test [<@scope>/]
-npm install-test [<@scope>/]@
-npm install-test [<@scope>/]@
-npm install-test [<@scope>/]@
-npm install-test @npm:
-npm install-test
-npm install-test
-npm install-test
-npm install-test
-npm install-test /
+npm install-test [ ...]
alias: it
```
diff --git a/deps/npm/docs/content/commands/npm-install.md b/deps/npm/docs/content/commands/npm-install.md
index d6668a2c2bd0fb..7e5544f85e3dda 100644
--- a/deps/npm/docs/content/commands/npm-install.md
+++ b/deps/npm/docs/content/commands/npm-install.md
@@ -11,16 +11,7 @@ description: Install a package
```bash
-npm install [<@scope>/]
-npm install [<@scope>/]@
-npm install [<@scope>/]@
-npm install [<@scope>/]@
-npm install @npm:
-npm install
-npm install
-npm install
-npm install
-npm install /
+npm install [ ...]
aliases: add, i, in, ins, inst, insta, instal, isnt, isnta, isntal, isntall
```
diff --git a/deps/npm/docs/content/commands/npm-link.md b/deps/npm/docs/content/commands/npm-link.md
index 975c807c38b348..8c1b422493bd57 100644
--- a/deps/npm/docs/content/commands/npm-link.md
+++ b/deps/npm/docs/content/commands/npm-link.md
@@ -11,8 +11,7 @@ description: Symlink a package folder
```bash
-npm link (in package dir)
-npm link [<@scope>/][@]
+npm link []
alias: ln
```
@@ -29,11 +28,11 @@ test iteratively without having to continually rebuild.
Package linking is a two-step process.
-First, `npm link` in a package folder will create a symlink in the global
-folder `{prefix}/lib/node_modules/` that links to the package
-where the `npm link` command was executed. It will also link any bins in
-the package to `{prefix}/bin/{name}`. Note that `npm link` uses the global
-prefix (see `npm prefix -g` for its value).
+First, `npm link` in a package folder with no arguments will create a
+symlink in the global folder `{prefix}/lib/node_modules/` that
+links to the package where the `npm link` command was executed. It will
+also link any bins in the package to `{prefix}/bin/{name}`. Note that
+`npm link` uses the global prefix (see `npm prefix -g` for its value).
Next, in some other location, `npm link package-name` will create a
symbolic link from globally-installed `package-name` to `node_modules/` of
@@ -399,6 +398,7 @@ symlink. This option has no effect on workspaces.
### See Also
+* [package spec](/using-npm/package-spec)
* [npm developers](/using-npm/developers)
* [package.json](/configuring-npm/package-json)
* [npm install](/commands/npm-install)
diff --git a/deps/npm/docs/content/commands/npm-ls.md b/deps/npm/docs/content/commands/npm-ls.md
index ded8c0c0d26ef1..a97c5168e6e0b4 100644
--- a/deps/npm/docs/content/commands/npm-ls.md
+++ b/deps/npm/docs/content/commands/npm-ls.md
@@ -11,7 +11,7 @@ description: List installed packages
```bash
-npm ls [[<@scope>/] ...]
+npm ls
alias: list
```
@@ -301,6 +301,7 @@ symlink. This option has no effect on workspaces.
### See Also
+* [package spec](/using-npm/package-spec)
* [npm explain](/commands/npm-explain)
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
diff --git a/deps/npm/docs/content/commands/npm-outdated.md b/deps/npm/docs/content/commands/npm-outdated.md
index 6fa026550e7477..c4e07a0cd36f02 100644
--- a/deps/npm/docs/content/commands/npm-outdated.md
+++ b/deps/npm/docs/content/commands/npm-outdated.md
@@ -11,7 +11,7 @@ description: Check for outdated packages
```bash
-npm outdated [[<@scope>/] ...]
+npm outdated [ ...]
```
@@ -192,6 +192,7 @@ This value is not exported to the environment for child processes.
### See Also
+* [package spec](/using-npm/package-spec)
* [npm update](/commands/npm-update)
* [npm dist-tag](/commands/npm-dist-tag)
* [npm registry](/using-npm/registry)
diff --git a/deps/npm/docs/content/commands/npm-owner.md b/deps/npm/docs/content/commands/npm-owner.md
index 72dfe6a22d01b0..ebc29ef6939392 100644
--- a/deps/npm/docs/content/commands/npm-owner.md
+++ b/deps/npm/docs/content/commands/npm-owner.md
@@ -11,9 +11,9 @@ description: Manage package owners
```bash
-npm owner add [<@scope>/]
-npm owner rm [<@scope>/]
-npm owner ls [<@scope>/]
+npm owner add
+npm owner rm
+npm owner ls
alias: author
```
@@ -123,6 +123,7 @@ This value is not exported to the environment for child processes.
### See Also
+* [package spec](/using-npm/package-spec)
* [npm profile](/commands/npm-profile)
* [npm publish](/commands/npm-publish)
* [npm registry](/using-npm/registry)
diff --git a/deps/npm/docs/content/commands/npm-pack.md b/deps/npm/docs/content/commands/npm-pack.md
index fa6c005e9d2287..7921042eae8fe0 100644
--- a/deps/npm/docs/content/commands/npm-pack.md
+++ b/deps/npm/docs/content/commands/npm-pack.md
@@ -11,7 +11,7 @@ description: Create a tarball from a package
```bash
-npm pack [[<@scope>/]...]
+npm pack
```
@@ -144,6 +144,7 @@ If no arguments are supplied, then npm packs the current package folder.
### See Also
+* [package spec](/using-npm/package-spec)
* [npm-packlist package](http://npm.im/npm-packlist)
* [npm cache](/commands/npm-cache)
* [npm publish](/commands/npm-publish)
diff --git a/deps/npm/docs/content/commands/npm-publish.md b/deps/npm/docs/content/commands/npm-publish.md
index 2995f6bc81551e..536d04988e6849 100644
--- a/deps/npm/docs/content/commands/npm-publish.md
+++ b/deps/npm/docs/content/commands/npm-publish.md
@@ -11,7 +11,7 @@ description: Publish a package
```bash
-npm publish []
+npm publish
```
@@ -23,42 +23,26 @@ npm publish []
Publishes a package to the registry so that it can be installed by name.
-By default npm will publish to the public registry. This can be overridden
-by specifying a different default registry or using a
-[`scope`](/using-npm/scope) in the name (see
+By default npm will publish to the public registry. This can be
+overridden by specifying a different default registry or using a
+[`scope`](/using-npm/scope) in the name, combined with a
+scope-configured registry (see
[`package.json`](/configuring-npm/package-json)).
-* ``: A folder containing a package.json file
-* ``: A url or file path to a gzipped tar archive containing a
- single folder with a package.json file inside.
+A `package` is interpreted the same way as other commands (like
+`npm install` and can be:
-* `[--tag ]`: Registers the published package with the given tag, such
- that `npm install @` will install this version. By default,
- `npm publish` updates and `npm install` installs the `latest` tag. See
- [`npm-dist-tag`](npm-dist-tag) for details about tags.
-
-* `[--access ]`: Tells the registry whether this package
- should be published as public or restricted. Only applies to scoped
- packages, which default to `restricted`. If you don't have a paid
- account, you must publish with `--access public` to publish scoped
- packages.
-
-* `[--otp ]`: If you have two-factor authentication enabled in
- `auth-and-writes` mode then you can provide a code from your
- authenticator with this. If you don't include this and you're running
- from a TTY then you'll be prompted.
-
-* `[--dry-run]`: As of `npm@6`, does everything publish would do except
- actually publishing to the registry. Reports the details of what would
- have been published.
-
-* `[--workspaces]`: Enables workspace context while publishing. All
- workspace packages will be published.
-
-* `[--workspace]`: Enables workspaces context and limits results to only
- those specified by this config item. Only the packages in the
- workspaces given will be published.
+* a) a folder containing a program described by a
+ [`package.json`](/configuring-npm/package-json) file
+* b) a gzipped tarball containing (a)
+* c) a url that resolves to (b)
+* d) a `@` that is published on the registry (see
+ [`registry`](/using-npm/registry)) with (c)
+* e) a `@` (see [`npm dist-tag`](/commands/npm-dist-tag)) that
+ points to (d)
+* f) a `` that has a "latest" tag satisfying (e)
+* g) a `` that resolves to (a)
The publish will fail if the package name and version combination already
exists in the specified registry.
@@ -247,6 +231,7 @@ This value is not exported to the environment for child processes.
### See Also
+* [package spec](/using-npm/package-spec)
* [npm-packlist package](http://npm.im/npm-packlist)
* [npm registry](/using-npm/registry)
* [npm scope](/using-npm/scope)
diff --git a/deps/npm/docs/content/commands/npm-rebuild.md b/deps/npm/docs/content/commands/npm-rebuild.md
index 52c368c8c513b9..6a396421213d3d 100644
--- a/deps/npm/docs/content/commands/npm-rebuild.md
+++ b/deps/npm/docs/content/commands/npm-rebuild.md
@@ -11,7 +11,7 @@ description: Rebuild a package
```bash
-npm rebuild [[<@scope>/][@] ...]
+npm rebuild [] ...]
alias: rb
```
@@ -29,9 +29,8 @@ C++ addons with the new binary. It is also useful when installing with
`--ignore-scripts` and `--no-bin-links`, to explicitly choose which
packages to build and/or link bins.
-If one or more package names (and optionally version ranges) are provided,
-then only packages with a name and version matching one of the specifiers
-will be rebuilt.
+If one or more package specs are provided, then only packages with a
+name and version matching one of the specifiers will be rebuilt.
### Configuration
@@ -178,4 +177,5 @@ symlink. This option has no effect on workspaces.
### See Also
+* [package spec](/using-npm/package-spec)
* [npm install](/commands/npm-install)
diff --git a/deps/npm/docs/content/commands/npm-restart.md b/deps/npm/docs/content/commands/npm-restart.md
index f01cd014e74357..048bebb1659bd3 100644
--- a/deps/npm/docs/content/commands/npm-restart.md
+++ b/deps/npm/docs/content/commands/npm-restart.md
@@ -69,7 +69,7 @@ will *not* run any pre- or post-scripts.
* Type: null or String
The shell to use for scripts run with the `npm exec`, `npm run` and `npm
-init ` commands.
+init ` commands.
diff --git a/deps/npm/docs/content/commands/npm-run-script.md b/deps/npm/docs/content/commands/npm-run-script.md
index 73c4b1c7a748a7..d94040f1a215d1 100644
--- a/deps/npm/docs/content/commands/npm-run-script.md
+++ b/deps/npm/docs/content/commands/npm-run-script.md
@@ -246,7 +246,7 @@ will *not* run any pre- or post-scripts.
* Type: null or String
The shell to use for scripts run with the `npm exec`, `npm run` and `npm
-init ` commands.
+init ` commands.
diff --git a/deps/npm/docs/content/commands/npm-star.md b/deps/npm/docs/content/commands/npm-star.md
index 00ef17a816b4ae..3e81c6a55bbb05 100644
--- a/deps/npm/docs/content/commands/npm-star.md
+++ b/deps/npm/docs/content/commands/npm-star.md
@@ -11,7 +11,7 @@ description: Mark your favorite packages
```bash
-npm star [...]
+npm star [...]
```
@@ -87,6 +87,7 @@ password, npm will prompt on the command line for one.
### See Also
+* [package spec](/using-npm/package-spec)
* [npm unstar](/commands/npm-unstar)
* [npm stars](/commands/npm-stars)
* [npm view](/commands/npm-view)
diff --git a/deps/npm/docs/content/commands/npm-start.md b/deps/npm/docs/content/commands/npm-start.md
index 8dd874b3c7d291..148f92606d83fb 100644
--- a/deps/npm/docs/content/commands/npm-start.md
+++ b/deps/npm/docs/content/commands/npm-start.md
@@ -80,7 +80,7 @@ will *not* run any pre- or post-scripts.
* Type: null or String
The shell to use for scripts run with the `npm exec`, `npm run` and `npm
-init ` commands.
+init ` commands.
diff --git a/deps/npm/docs/content/commands/npm-stop.md b/deps/npm/docs/content/commands/npm-stop.md
index 9a3a55cf3f20e6..a3084e8432ba77 100644
--- a/deps/npm/docs/content/commands/npm-stop.md
+++ b/deps/npm/docs/content/commands/npm-stop.md
@@ -73,7 +73,7 @@ will *not* run any pre- or post-scripts.
* Type: null or String
The shell to use for scripts run with the `npm exec`, `npm run` and `npm
-init ` commands.
+init ` commands.
diff --git a/deps/npm/docs/content/commands/npm-test.md b/deps/npm/docs/content/commands/npm-test.md
index 8a343ab299b34c..72bb899d0b9165 100644
--- a/deps/npm/docs/content/commands/npm-test.md
+++ b/deps/npm/docs/content/commands/npm-test.md
@@ -70,7 +70,7 @@ will *not* run any pre- or post-scripts.
* Type: null or String
The shell to use for scripts run with the `npm exec`, `npm run` and `npm
-init ` commands.
+init ` commands.
diff --git a/deps/npm/docs/content/commands/npm-unpublish.md b/deps/npm/docs/content/commands/npm-unpublish.md
index a4c481ea5af7f7..9ad99e72a5a8e0 100644
--- a/deps/npm/docs/content/commands/npm-unpublish.md
+++ b/deps/npm/docs/content/commands/npm-unpublish.md
@@ -11,7 +11,7 @@ description: Remove a package from the registry
```bash
-npm unpublish [<@scope>/][@]
+npm unpublish []
```
@@ -146,6 +146,7 @@ This value is not exported to the environment for child processes.
### See Also
+* [package spec](/using-npm/package-spec)
* [npm deprecate](/commands/npm-deprecate)
* [npm publish](/commands/npm-publish)
* [npm registry](/using-npm/registry)
diff --git a/deps/npm/docs/content/commands/npm-unstar.md b/deps/npm/docs/content/commands/npm-unstar.md
index 76202190da8c35..636e1b6ac0a947 100644
--- a/deps/npm/docs/content/commands/npm-unstar.md
+++ b/deps/npm/docs/content/commands/npm-unstar.md
@@ -11,7 +11,7 @@ description: Remove an item from your favorite packages
```bash
-npm unstar [...]
+npm unstar [...]
```
diff --git a/deps/npm/docs/content/commands/npm-view.md b/deps/npm/docs/content/commands/npm-view.md
index 0ef17d8adfb39b..d9d1daac0cda7d 100644
--- a/deps/npm/docs/content/commands/npm-view.md
+++ b/deps/npm/docs/content/commands/npm-view.md
@@ -11,7 +11,7 @@ description: View registry info
```bash
-npm view [<@scope>/][@] [[.subfield]...]
+npm view [] [[.subfield]...]
aliases: info, show, v
```
@@ -203,6 +203,7 @@ the field name.
### See Also
+* [package spec](/using-npm/package-spec)
* [npm search](/commands/npm-search)
* [npm registry](/using-npm/registry)
* [npm config](/commands/npm-config)
diff --git a/deps/npm/docs/content/configuring-npm/package-json.md b/deps/npm/docs/content/configuring-npm/package-json.md
index 8b188cfb0b9380..64081350af271f 100644
--- a/deps/npm/docs/content/configuring-npm/package-json.md
+++ b/deps/npm/docs/content/configuring-npm/package-json.md
@@ -222,7 +222,7 @@ npm also sets a top-level "maintainers" field with your npm user info.
### funding
-You can specify an object containing an URL that provides up-to-date
+You can specify an object containing a URL that provides up-to-date
information about ways to help fund development of your package, or a
string URL, or an array of these:
diff --git a/deps/npm/docs/content/using-npm/config.md b/deps/npm/docs/content/using-npm/config.md
index 6ef854eb6e0ff4..3fb431402669f5 100644
--- a/deps/npm/docs/content/using-npm/config.md
+++ b/deps/npm/docs/content/using-npm/config.md
@@ -1518,7 +1518,7 @@ npm init --scope=@foo --yes
* Type: null or String
The shell to use for scripts run with the `npm exec`, `npm run` and `npm
-init ` commands.
+init ` commands.
diff --git a/deps/npm/docs/content/using-npm/package-spec.md b/deps/npm/docs/content/using-npm/package-spec.md
new file mode 100644
index 00000000000000..0d3741018f036f
--- /dev/null
+++ b/deps/npm/docs/content/using-npm/package-spec.md
@@ -0,0 +1,106 @@
+---
+title: package-spec
+section: 7
+description: Package name specifier
+---
+
+
+### Description
+
+Commands like `npm install` and the dependency sections in the
+`package.json` use a package name specifier. This can be many different
+things that all refer to a "package". Examples include a package name,
+git url, tarball, or local directory. These will generally be referred
+to as `` in the help output for the npm commands that use
+this package name specifier.
+
+### Package name
+
+* `[<@scope>/]`
+* `[<@scope>/]@`
+* `[<@scope>/]@`
+* `[<@scope>/]@`
+
+Refers to a package by name, with or without a scope, and optionally
+tag, version, or version range. This is typically used in combination
+with the [registry](/using-npm/config#registry) config to refer to a
+package in a registry.
+
+Examples:
+* `npm`
+* `@npmcli/arborist`
+* `@npmcli/arborist@latest`
+* `npm@6.13.1`
+* `npm@^4.0.0`
+
+### Aliases
+
+* `@npm:`
+
+Primarily used by commands like `npm install` and in the dependency
+sections in the `package.json`, this refers to a package by an alias.
+The `` is the name of the package as it is reified in the
+`node_modules` folder, and the `` refers to a package name as
+found in the configured registry.
+
+See `Package name` above for more info on referring to a package by
+name, and [registry](/using-npm/config#registry) for configuring which
+registry is used when referring to a package by name.
+
+Examples:
+* `semver:@npm:@npmcli/semver-with-patch`
+* `semver:@npm:semver@7.2.2`
+* `semver:@npm:semver@legacy`
+
+### Folders
+
+* ``
+
+This refers to a package on the local filesystem. Specifically this is
+a folder with a `package.json` file in it. This *should* always be
+prefixed with a `/` or `./` (or your OS equivalent) to reduce confusion.
+npm currently will parse a string with more than one `/` in it as a
+folder, but this is legacy behavior that may be removed in a future
+version.
+
+Examples:
+
+* `./my-package`
+* `/opt/npm/my-package`
+
+### Tarballs
+
+* ``
+* ``
+
+Examples:
+
+* `./my-package.tgz`
+* `https://registry.npmjs.org/semver/-/semver-1.0.0.tgz`
+
+Refers to a package in a tarball format, either on the local filesystem
+or remotely via url. This is the format that packages exist in when
+uploaded to a registry.
+
+### git urls
+
+* ``
+* `/`
+
+Refers to a package in a git repo. This can be a full git url, git
+shorthand, or a username/package on GitHub. You can specify a
+git tag, branch, or other git ref by appending `#ref`.
+
+Examples:
+
+* `https://github.com/npm/cli.git`
+* `git@github.com:npm/cli.git`
+* `git+ssh://git@github.com/npm/cli#v6.0.0`
+* `github:npm/cli#HEAD`
+* `npm/cli#c12ea07`
+
+### See also
+
+[npm-package-arg](https://npm.im/npm-package-arg)
+[scope](/using-npm/scope)
+[config](/using-npm/config)
diff --git a/deps/npm/docs/output/commands/npm-cache.html b/deps/npm/docs/output/commands/npm-cache.html
index c5d6869b343be2..ad29cc73819d58 100644
--- a/deps/npm/docs/output/commands/npm-cache.html
+++ b/deps/npm/docs/output/commands/npm-cache.html
@@ -149,11 +149,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. If you have two-factor
-authentication on auth-and-writes then you’ll need to include a one-time
-password on the command line with --otp <one-time password>, or at the
-OTP prompt.
+
add: Tags the specified version of the package with the specified tag,
+or the --tag config if not specified. If you have two-factor
+authentication on auth-and-writes then you’ll need to include a
+one-time password on the command line with
+--otp <one-time password>, or at the OTP prompt.
rm: Clear a tag that is no longer in use from the package. If you have
@@ -273,6 +273,7 @@
This command will print the chain of dependencies causing a given package
to be installed in the current project.
-
Positional arguments can be either folders within node_modules, or
-name@version-range specifiers, which will select the dependency
-relationships to explain.
+
If one or more package specs are provided, then only packages matching
+one of the specifiers will have their relationships explained.
+
The package spec can also refer to a folder within ./node_modules
For example, running npm explain glob within npm's source tree will show:
This command retrieves information on how to fund the dependencies of a
given project. If no package name is provided, it will list all
-dependencies that are looking for funding in a tree structure, listing the
-type of funding and the url to visit. If a package name is provided then it
-tries to open its funding url using the --browser config param; if there
-are multiple funding sources for the package, the user will be instructed
-to pass the --which option to disambiguate.
+dependencies that are looking for funding in a tree structure, listing
+the type of funding and the url to visit. If a package name is provided
+then it tries to open its funding url using the --browser config
+param; if there are multiple funding sources for the package, the user
+will be instructed to pass the --which option to disambiguate.
The list will avoid duplicated entries and will stack all packages that
-share the same url as a single entry. Thus, the list does not have the same
-shape of the output from npm ls.
+share the same url as a single entry. Thus, the list does not have the
+same shape of the output from npm ls.
Example
Workspaces support
-
It's possible to filter the results to only include a single workspace and its
-dependencies using the workspace config option.
+
It's possible to filter the results to only include a single workspace
+and its dependencies using the workspace config option.
Example:
Here's an example running npm fund in a project with a configured
workspace a:
@@ -183,8 +183,8 @@
Example:
`-- https://example.com/org
`-- bar@2.0.0
-
And here is an example of the expected result when filtering only by
-a specific workspace a in the same project:
+
And here is an example of the expected result when filtering only by a
+specific workspace a in the same project:
$ npm fund -w a
test-workspaces-fund@1.0.0
`-- https://example.com/a
@@ -262,6 +262,7 @@
npm init <package-spec> (same as `npx <package-spec>)
npm init <@scope> (same as `npx <@scope>/create`)
-npm init [<@scope>/]<name> (same as `npx [<@scope>/]create-<name>`)
aliases: create, innit
@@ -300,6 +299,29 @@
force
recommended that you do not use this option!
+
scope
+
+
Default: the scope of the current project, if any, or ""
+
Type: String
+
+
Associate an operation with a scope for a scoped registry.
+
Useful when logging in to or out of a private registry:
+
# log in, linking the scope to the custom registry
+npm login --scope=@mycorp --registry=https://registry.mycorp.com
+
+# log out, removing the link and the auth token
+npm logout --scope=@mycorp
+
+
This will cause @mycorp to be mapped to the registry for future
+installation of packages specified according to the pattern
+@mycorp/package.
+
This will also cause npm init to create a scoped package.
+
# accept all defaults, and create a package named "@foo/whatever",
+# instead of just named "whatever"
+npm init --scope=@foo --yes
+
npm link (in package dir)
-npm link [<@scope>/]<pkg>[@<version>]
+
npm link [<package-spec>]
alias: ln
@@ -161,11 +160,11 @@
Description
This is handy for installing your own stuff, so that you can work on it and
test iteratively without having to continually rebuild.
Package linking is a two-step process.
-
First, npm link in a package folder will create a symlink in the global
-folder {prefix}/lib/node_modules/<package> that links to the package
-where the npm link command was executed. It will also link any bins in
-the package to {prefix}/bin/{name}. Note that npm link uses the global
-prefix (see npm prefix -g for its value).
+
First, npm link in a package folder with no arguments will create a
+symlink in the global folder {prefix}/lib/node_modules/<package> that
+links to the package where the npm link command was executed. It will
+also link any bins in the package to {prefix}/bin/{name}. Note that
+npm link uses the global prefix (see npm prefix -g for its value).
Next, in some other location, npm link package-name will create a
symbolic link from globally-installed package-name to node_modules/ of
the current folder.
the results to only the paths to the packages named. Note that nested
packages will also show the paths to the specified packages. For
example, running npm ls promzard in npm's source tree will show:
-
Publishes a package to the registry so that it can be installed by name.
-
By default npm will publish to the public registry. This can be overridden
-by specifying a different default registry or using a
-scope in the name (see
+
By default npm will publish to the public registry. This can be
+overridden by specifying a different default registry or using a
+scope in the name, combined with a
+scope-configured registry (see
package.json).
+
A package is interpreted the same way as other commands (like
+npm install and can be:
-
-
<folder>: A folder containing a package.json file
-
-
-
<tarball>: A url or file path to a gzipped tar archive containing a
-single folder with a package.json file inside.
-
-
-
[--tag <tag>]: Registers the published package with the given tag, such
-that npm install <name>@<tag> will install this version. By default,
-npm publish updates and npm install installs the latest tag. See
-npm-dist-tag for details about tags.
-
-
-
[--access <public|restricted>]: Tells the registry whether this package
-should be published as public or restricted. Only applies to scoped
-packages, which default to restricted. If you don't have a paid
-account, you must publish with --access public to publish scoped
-packages.
-
-
-
[--otp <otpcode>]: If you have two-factor authentication enabled in
-auth-and-writes mode then you can provide a code from your
-authenticator with this. If you don't include this and you're running
-from a TTY then you'll be prompted.
-
-
-
[--dry-run]: As of npm@6, does everything publish would do except
-actually publishing to the registry. Reports the details of what would
-have been published.
-
-
-
[--workspaces]: Enables workspace context while publishing. All
-workspace packages will be published.
-
-
-
[--workspace]: Enables workspaces context and limits results to only
-those specified by this config item. Only the packages in the
-workspaces given will be published.
-
+
a) a folder containing a program described by a
+package.json file
+
b) a gzipped tarball containing (a)
+
c) a url that resolves to (b)
+
d) a <name>@<version> that is published on the registry (see
+registry) with (c)
+
e) a <name>@<tag> (see npm dist-tag) that
+points to (d)
+
f) a <name> that has a "latest" tag satisfying (e)
+
g) a <git remote url> that resolves to (a)
The publish will fail if the package name and version combination already
exists in the specified registry.
C++ addons with the new binary. It is also useful when installing with
--ignore-scripts and --no-bin-links, to explicitly choose which
packages to build and/or link bins.
-
If one or more package names (and optionally version ranges) are provided,
-then only packages with a name and version matching one of the specifiers
-will be rebuilt.
+
If one or more package specs are provided, then only packages with a
+name and version matching one of the specifiers will be rebuilt.
npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
diff --git a/deps/npm/docs/output/configuring-npm/package-json.html b/deps/npm/docs/output/configuring-npm/package-json.html
index d5860ee6e299a1..a3bcd299c5bbe6 100644
--- a/deps/npm/docs/output/configuring-npm/package-json.html
+++ b/deps/npm/docs/output/configuring-npm/package-json.html
@@ -304,7 +304,7 @@
people fields: author, contributors
Both email and url are optional either way.
npm also sets a top-level "maintainers" field with your npm user info.
funding
-
You can specify an object containing an URL that provides up-to-date
+
You can specify an object containing a URL that provides up-to-date
information about ways to help fund development of your package, or a
string URL, or an array of these:
Commands like npm install and the dependency sections in the
+package.json use a package name specifier. This can be many different
+things that all refer to a "package". Examples include a package name,
+git url, tarball, or local directory. These will generally be referred
+to as <package-spec> in the help output for the npm commands that use
+this package name specifier.
+
Package name
+
+
[<@scope>/]<pkg>
+
[<@scope>/]<pkg>@<tag>
+
[<@scope>/]<pkg>@<version>
+
[<@scope>/]<pkg>@<version range>
+
+
Refers to a package by name, with or without a scope, and optionally
+tag, version, or version range. This is typically used in combination
+with the registry config to refer to a
+package in a registry.
+
Examples:
+
+
npm
+
@npmcli/arborist
+
@npmcli/arborist@latest
+
npm@6.13.1
+
npm@^4.0.0
+
+
Aliases
+
+
<alias>@npm:<name>
+
+
Primarily used by commands like npm install and in the dependency
+sections in the package.json, this refers to a package by an alias.
+The <alias> is the name of the package as it is reified in the
+node_modules folder, and the <name> refers to a package name as
+found in the configured registry.
+
See Package name above for more info on referring to a package by
+name, and registry for configuring which
+registry is used when referring to a package by name.
+
Examples:
+
+
semver:@npm:@npmcli/semver-with-patch
+
semver:@npm:semver@7.2.2
+
semver:@npm:semver@legacy
+
+
Folders
+
+
<folder>
+
+
This refers to a package on the local filesystem. Specifically this is
+a folder with a package.json file in it. This should always be
+prefixed with a / or ./ (or your OS equivalent) to reduce confusion.
+npm currently will parse a string with more than one / in it as a
+folder, but this is legacy behavior that may be removed in a future
+version.
Refers to a package in a tarball format, either on the local filesystem
+or remotely via url. This is the format that packages exist in when
+uploaded to a registry.
+
git urls
+
+
<git:// url>
+
<github username>/<github project>
+
+
Refers to a package in a git repo. This can be a full git url, git
+shorthand, or a username/package on GitHub. You can specify a
+git tag, branch, or other git ref by appending #ref.
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/deps/npm/lib/auth/legacy.js b/deps/npm/lib/auth/legacy.js
index d1401ce14b9ef1..9aed12f3926fbe 100644
--- a/deps/npm/lib/auth/legacy.js
+++ b/deps/npm/lib/auth/legacy.js
@@ -1,6 +1,6 @@
const profile = require('npm-profile')
const log = require('../utils/log-shim')
-const openUrl = require('../utils/open-url.js')
+const openUrlPrompt = require('../utils/open-url-prompt.js')
const read = require('../utils/read-user-info.js')
const loginPrompter = async (creds) => {
@@ -47,7 +47,15 @@ const login = async (npm, opts) => {
return newUser
}
- const openerPromise = (url) => openUrl(npm, url, 'to complete your login please visit')
+ const openerPromise = (url, emitter) =>
+ openUrlPrompt(
+ npm,
+ url,
+ 'Authenticate your account at',
+ 'Press ENTER to open in the browser...',
+ emitter
+ )
+
try {
res = await profile.login(openerPromise, loginPrompter, opts)
} catch (err) {
diff --git a/deps/npm/lib/commands/cache.js b/deps/npm/lib/commands/cache.js
index 862f346adb4369..bc52889c0006fb 100644
--- a/deps/npm/lib/commands/cache.js
+++ b/deps/npm/lib/commands/cache.js
@@ -68,11 +68,7 @@ class Cache extends BaseCommand {
static name = 'cache'
static params = ['cache']
static usage = [
- 'add ',
- 'add ',
- 'add ',
- 'add ',
- 'add @',
+ 'add ',
'clean []',
'ls [@]',
'verify',
diff --git a/deps/npm/lib/commands/deprecate.js b/deps/npm/lib/commands/deprecate.js
index 0ae88f1921f566..862c214dbe592f 100644
--- a/deps/npm/lib/commands/deprecate.js
+++ b/deps/npm/lib/commands/deprecate.js
@@ -9,7 +9,7 @@ const BaseCommand = require('../base-command.js')
class Deprecate extends BaseCommand {
static description = 'Deprecate a version of a package'
static name = 'deprecate'
- static usage = ['[@] ']
+ static usage = ['']
static params = [
'registry',
'otp',
diff --git a/deps/npm/lib/commands/dist-tag.js b/deps/npm/lib/commands/dist-tag.js
index a207e422cb53c1..e74a3f1d435c9b 100644
--- a/deps/npm/lib/commands/dist-tag.js
+++ b/deps/npm/lib/commands/dist-tag.js
@@ -12,9 +12,9 @@ class DistTag extends BaseCommand {
static params = ['workspace', 'workspaces', 'include-workspace-root']
static name = 'dist-tag'
static usage = [
- 'add @ []',
- 'rm ',
- 'ls []',
+ 'add []',
+ 'rm ',
+ 'ls []',
]
static ignoreImplicitWorkspace = false
@@ -90,7 +90,7 @@ class DistTag extends BaseCommand {
log.verbose('dist-tag add', defaultTag, 'to', spec.name + '@' + version)
if (!spec.name || !version || !defaultTag) {
- throw this.usageError()
+ throw this.usageError('must provide a spec with a name and version, and a tag to add')
}
const t = defaultTag.trim()
diff --git a/deps/npm/lib/commands/explain.js b/deps/npm/lib/commands/explain.js
index ca6ee7540bc916..c0ef04548a4ed3 100644
--- a/deps/npm/lib/commands/explain.js
+++ b/deps/npm/lib/commands/explain.js
@@ -10,7 +10,7 @@ const ArboristWorkspaceCmd = require('../arborist-cmd.js')
class Explain extends ArboristWorkspaceCmd {
static description = 'Explain installed packages'
static name = 'explain'
- static usage = ['']
+ static usage = ['']
static params = [
'json',
'workspace',
diff --git a/deps/npm/lib/commands/fund.js b/deps/npm/lib/commands/fund.js
index 09ca81653b0eb3..9690cbc32e0792 100644
--- a/deps/npm/lib/commands/fund.js
+++ b/deps/npm/lib/commands/fund.js
@@ -20,7 +20,7 @@ class Fund extends ArboristWorkspaceCmd {
static description = 'Retrieve funding information'
static name = 'fund'
static params = ['json', 'browser', 'unicode', 'workspace', 'which']
- static usage = ['[[<@scope>/]]']
+ static usage = ['[]']
// TODO
/* istanbul ignore next */
diff --git a/deps/npm/lib/commands/init.js b/deps/npm/lib/commands/init.js
index 4c299e65137bed..b8b6bd5d53e088 100644
--- a/deps/npm/lib/commands/init.js
+++ b/deps/npm/lib/commands/init.js
@@ -18,6 +18,7 @@ class Init extends BaseCommand {
static params = [
'yes',
'force',
+ 'scope',
'workspace',
'workspaces',
'workspaces-update',
@@ -26,9 +27,8 @@ class Init extends BaseCommand {
static name = 'init'
static usage = [
- '[--force|-f|--yes|-y|--scope]',
+ ' (same as `npx )',
'<@scope> (same as `npx <@scope>/create`)',
- '[<@scope>/] (same as `npx [<@scope>/]create-`)',
]
static ignoreImplicitWorkspace = false
diff --git a/deps/npm/lib/commands/install.js b/deps/npm/lib/commands/install.js
index 4cda36448317fe..ecc0727a2ef7c4 100644
--- a/deps/npm/lib/commands/install.js
+++ b/deps/npm/lib/commands/install.js
@@ -34,18 +34,7 @@ class Install extends ArboristWorkspaceCmd {
...super.params,
]
- static usage = [
- '[<@scope>/]',
- '[<@scope>/]@',
- '[<@scope>/]@',
- '[<@scope>/]@',
- '@npm:',
- '',
- '',
- '',
- '',
- '/',
- ]
+ static usage = ['[ ...]']
async completion (opts) {
const { partialWord } = opts
diff --git a/deps/npm/lib/commands/link.js b/deps/npm/lib/commands/link.js
index 80a60d36e324e9..b0b889ea787fd5 100644
--- a/deps/npm/lib/commands/link.js
+++ b/deps/npm/lib/commands/link.js
@@ -15,8 +15,7 @@ class Link extends ArboristWorkspaceCmd {
static description = 'Symlink a package folder'
static name = 'link'
static usage = [
- '(in package dir)',
- '[<@scope>/][@]',
+ '[]',
]
static params = [
diff --git a/deps/npm/lib/commands/ls.js b/deps/npm/lib/commands/ls.js
index cfd9cb5a5051ca..d3932072b7d348 100644
--- a/deps/npm/lib/commands/ls.js
+++ b/deps/npm/lib/commands/ls.js
@@ -27,7 +27,7 @@ const localeCompare = require('@isaacs/string-locale-compare')('en')
class LS extends ArboristWorkspaceCmd {
static description = 'List installed packages'
static name = 'ls'
- static usage = ['[[<@scope>/] ...]']
+ static usage = ['']
static params = [
'all',
'json',
diff --git a/deps/npm/lib/commands/outdated.js b/deps/npm/lib/commands/outdated.js
index 081e75a2c61d36..042b776f71e0d8 100644
--- a/deps/npm/lib/commands/outdated.js
+++ b/deps/npm/lib/commands/outdated.js
@@ -15,7 +15,7 @@ const ArboristWorkspaceCmd = require('../arborist-cmd.js')
class Outdated extends ArboristWorkspaceCmd {
static description = 'Check for outdated packages'
static name = 'outdated'
- static usage = ['[[<@scope>/] ...]']
+ static usage = ['[ ...]']
static params = [
'all',
'json',
diff --git a/deps/npm/lib/commands/owner.js b/deps/npm/lib/commands/owner.js
index 4797e9c7ec84b4..732bb40a300502 100644
--- a/deps/npm/lib/commands/owner.js
+++ b/deps/npm/lib/commands/owner.js
@@ -27,9 +27,9 @@ class Owner extends BaseCommand {
]
static usage = [
- 'add [<@scope>/]',
- 'rm [<@scope>/]',
- 'ls [<@scope>/]',
+ 'add ',
+ 'rm ',
+ 'ls ',
]
static ignoreImplicitWorkspace = false
diff --git a/deps/npm/lib/commands/pack.js b/deps/npm/lib/commands/pack.js
index 8190ceecaf94bc..c6a74804642f66 100644
--- a/deps/npm/lib/commands/pack.js
+++ b/deps/npm/lib/commands/pack.js
@@ -17,7 +17,7 @@ class Pack extends BaseCommand {
'include-workspace-root',
]
- static usage = ['[[<@scope>/]...]']
+ static usage = ['']
static ignoreImplicitWorkspace = false
async exec (args) {
diff --git a/deps/npm/lib/commands/publish.js b/deps/npm/lib/commands/publish.js
index da6437fa9c58fc..579f5d6e74e67c 100644
--- a/deps/npm/lib/commands/publish.js
+++ b/deps/npm/lib/commands/publish.js
@@ -37,7 +37,7 @@ class Publish extends BaseCommand {
'include-workspace-root',
]
- static usage = ['[]']
+ static usage = ['']
static ignoreImplicitWorkspace = false
async exec (args) {
diff --git a/deps/npm/lib/commands/rebuild.js b/deps/npm/lib/commands/rebuild.js
index 3e6046d8df22b0..d06313ce483a95 100644
--- a/deps/npm/lib/commands/rebuild.js
+++ b/deps/npm/lib/commands/rebuild.js
@@ -16,7 +16,7 @@ class Rebuild extends ArboristWorkspaceCmd {
...super.params,
]
- static usage = ['[[<@scope>/][@] ...]']
+ static usage = ['[] ...]']
// TODO
/* istanbul ignore next */
diff --git a/deps/npm/lib/commands/star.js b/deps/npm/lib/commands/star.js
index 7b76be3c1632d5..20039bf8938116 100644
--- a/deps/npm/lib/commands/star.js
+++ b/deps/npm/lib/commands/star.js
@@ -7,7 +7,7 @@ const BaseCommand = require('../base-command.js')
class Star extends BaseCommand {
static description = 'Mark your favorite packages'
static name = 'star'
- static usage = ['[...]']
+ static usage = ['[...]']
static params = [
'registry',
'unicode',
diff --git a/deps/npm/lib/commands/unpublish.js b/deps/npm/lib/commands/unpublish.js
index f27be2e41c1078..ab929d98cadfa3 100644
--- a/deps/npm/lib/commands/unpublish.js
+++ b/deps/npm/lib/commands/unpublish.js
@@ -20,7 +20,7 @@ class Unpublish extends BaseCommand {
static description = 'Remove a package from the registry'
static name = 'unpublish'
static params = ['dry-run', 'force', 'workspace', 'workspaces']
- static usage = ['[<@scope>/][@]']
+ static usage = ['[]']
static ignoreImplicitWorkspace = false
async getKeysOfVersions (name, opts) {
diff --git a/deps/npm/lib/commands/view.js b/deps/npm/lib/commands/view.js
index efb298a03bc359..3b8524ad3fc0d5 100644
--- a/deps/npm/lib/commands/view.js
+++ b/deps/npm/lib/commands/view.js
@@ -33,7 +33,7 @@ class View extends BaseCommand {
static ignoreImplicitWorkspace = false
- static usage = ['[<@scope>/][@] [[.subfield]...]']
+ static usage = ['[] [[.subfield]...]']
async completion (opts) {
if (opts.conf.argv.remain.length <= 2) {
@@ -236,6 +236,15 @@ class View extends BaseCommand {
}
})
+ // No data has been pushed because no data is matching the specified version
+ if (data.length === 0 && version !== 'latest') {
+ const er = new Error(`No match found for version ${version}`)
+ er.statusCode = 404
+ er.code = 'E404'
+ er.pkgid = `${pckmnt._id}@${version}`
+ throw er
+ }
+
if (
!this.npm.config.get('json') &&
args.length === 1 &&
diff --git a/deps/npm/lib/utils/config/definitions.js b/deps/npm/lib/utils/config/definitions.js
index 4c77e375c5ccf3..6b35e7d4d05b4c 100644
--- a/deps/npm/lib/utils/config/definitions.js
+++ b/deps/npm/lib/utils/config/definitions.js
@@ -535,7 +535,7 @@ define('dev', {
define('diff', {
default: [],
- hint: '',
+ hint: '',
type: [String, Array],
description: `
Define arguments to compare in \`npm diff\`.
@@ -1458,7 +1458,7 @@ define('otp', {
define('package', {
default: [],
- hint: '[@]',
+ hint: '',
type: [String, Array],
description: `
The package to install for [\`npm exec\`](/commands/npm-exec)
@@ -1867,7 +1867,7 @@ define('script-shell', {
type: [null, String],
description: `
The shell to use for scripts run with the \`npm exec\`,
- \`npm run\` and \`npm init \` commands.
+ \`npm run\` and \`npm init \` commands.
`,
flatten (key, obj, flatOptions) {
flatOptions.scriptShell = obj[key] || undefined
diff --git a/deps/npm/lib/utils/open-url-prompt.js b/deps/npm/lib/utils/open-url-prompt.js
new file mode 100644
index 00000000000000..3eb3ac288c0355
--- /dev/null
+++ b/deps/npm/lib/utils/open-url-prompt.js
@@ -0,0 +1,69 @@
+const readline = require('readline')
+const opener = require('opener')
+
+function print (npm, title, url) {
+ const json = npm.config.get('json')
+
+ const message = json ? JSON.stringify({ title, url }) : `${title}:\n${url}`
+
+ npm.output(message)
+}
+
+// Prompt to open URL in browser if possible
+const promptOpen = async (npm, url, title, prompt, emitter) => {
+ const browser = npm.config.get('browser')
+ const isInteractive = process.stdin.isTTY === true && process.stdout.isTTY === true
+
+ try {
+ if (!/^https?:$/.test(new URL(url).protocol)) {
+ throw new Error()
+ }
+ } catch (_) {
+ throw new Error('Invalid URL: ' + url)
+ }
+
+ print(npm, title, url)
+
+ if (browser === false || !isInteractive) {
+ return
+ }
+
+ const rl = readline.createInterface({
+ input: process.stdin,
+ output: process.stdout,
+ })
+
+ const tryOpen = await new Promise(resolve => {
+ rl.question(prompt, () => {
+ resolve(true)
+ })
+
+ if (emitter && emitter.addListener) {
+ emitter.addListener('abort', () => {
+ rl.close()
+
+ // clear the prompt line
+ npm.output('')
+
+ resolve(false)
+ })
+ }
+ })
+
+ if (!tryOpen) {
+ return
+ }
+
+ const command = browser === true ? null : browser
+ await new Promise((resolve, reject) => {
+ opener(url, { command }, err => {
+ if (err) {
+ return reject(err)
+ }
+
+ return resolve()
+ })
+ })
+}
+
+module.exports = promptOpen
diff --git a/deps/npm/man/man1/npm-cache.1 b/deps/npm/man/man1/npm-cache.1
index 42e1998371c0e4..30b4947bd0b24b 100644
--- a/deps/npm/man/man1/npm-cache.1
+++ b/deps/npm/man/man1/npm-cache.1
@@ -5,11 +5,7 @@
.P
.RS 2
.nf
-npm cache add
-npm cache add
-npm cache add
-npm cache add
-npm cache add @
+npm cache add
npm cache clean []
npm cache ls [@]
npm cache verify
@@ -85,6 +81,8 @@ cache\fP
.SS See Also
.RS 0
.IP \(bu 2
+npm help package spec
+.IP \(bu 2
npm help folders
.IP \(bu 2
npm help config
diff --git a/deps/npm/man/man1/npm-ci.1 b/deps/npm/man/man1/npm-ci.1
index 533ec91005862d..5c92d5d9ba7059 100644
--- a/deps/npm/man/man1/npm-ci.1
+++ b/deps/npm/man/man1/npm-ci.1
@@ -133,7 +133,7 @@ Type: null or String
.RE
.P
The shell to use for scripts run with the \fBnpm exec\fP, \fBnpm run\fP and \fBnpm
-init \fP commands\.
+init \fP commands\.
.SS See Also
.RS 0
.IP \(bu 2
diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1
index e9ab9bae71a6fb..7f9fe808f5013c 100644
--- a/deps/npm/man/man1/npm-deprecate.1
+++ b/deps/npm/man/man1/npm-deprecate.1
@@ -5,7 +5,7 @@
.P
.RS 2
.nf
-npm deprecate [@]
+npm deprecate
.fi
.RE
.P
@@ -38,8 +38,8 @@ In this case, a version \fBmy\-thing@1\.0\.0\-beta\.0\fP will also be deprecated
You must be the package owner to deprecate something\. See the \fBowner\fP and
\fBadduser\fP help topics\.
.P
-To un\-deprecate a package, specify an empty string (\fB""\fP) for the \fBmessage\fP
-argument\. Note that you must use double quotes with no space between them to
+To un\-deprecate a package, specify an empty string (\fB""\fP) for the \fBmessage\fP
+argument\. Note that you must use double quotes with no space between them to
format an empty string\.
.SS Configuration
.SS \fBregistry\fP
@@ -69,6 +69,8 @@ password, npm will prompt on the command line for one\.
.SS See Also
.RS 0
.IP \(bu 2
+npm help package spec
+.IP \(bu 2
npm help publish
.IP \(bu 2
npm help registry
diff --git a/deps/npm/man/man1/npm-dist-tag.1 b/deps/npm/man/man1/npm-dist-tag.1
index 7e1c14539540d7..7334c059d4d7f5 100644
--- a/deps/npm/man/man1/npm-dist-tag.1
+++ b/deps/npm/man/man1/npm-dist-tag.1
@@ -5,9 +5,9 @@
.P
.RS 2
.nf
-npm dist\-tag add @ []
-npm dist\-tag rm
-npm dist\-tag ls []
+npm dist\-tag add []
+npm dist\-tag rm
+npm dist\-tag ls []
alias: dist\-tags
.fi
@@ -17,11 +17,11 @@ alias: dist\-tags
Add, remove, and enumerate distribution tags on a package:
.RS 0
.IP \(bu 2
-add: Tags the specified version of the package with the specified tag, or
-the \fB\-\-tag\fP config if not specified\. If you have two\-factor
-authentication on auth\-and\-writes then you’ll need to include a one\-time
-password on the command line with \fB\-\-otp \fP, or at the
-OTP prompt\.
+add: Tags the specified version of the package with the specified tag,
+or the \fB\-\-tag\fP config if not specified\. If you have two\-factor
+authentication on auth\-and\-writes then you’ll need to include a
+one\-time password on the command line with
+\fB\-\-otp \fP, or at the OTP prompt\.
.IP \(bu 2
rm: Clear a tag that is no longer in use from the package\. If you have
two\-factor authentication on auth\-and\-writes then you’ll need to include
@@ -164,6 +164,8 @@ This value is not exported to the environment for child processes\.
.SS See Also
.RS 0
.IP \(bu 2
+npm help package spec
+.IP \(bu 2
npm help publish
.IP \(bu 2
npm help install
diff --git a/deps/npm/man/man1/npm-explain.1 b/deps/npm/man/man1/npm-explain.1
index 9a3eec6756ddd8..fc7c2f2343b3d0 100644
--- a/deps/npm/man/man1/npm-explain.1
+++ b/deps/npm/man/man1/npm-explain.1
@@ -5,7 +5,7 @@
.P
.RS 2
.nf
-npm explain
+npm explain
alias: why
.fi
@@ -15,9 +15,10 @@ alias: why
This command will print the chain of dependencies causing a given package
to be installed in the current project\.
.P
-Positional arguments can be either folders within \fBnode_modules\fP, or
-\fBname@version\-range\fP specifiers, which will select the dependency
-relationships to explain\.
+If one or more package specs are provided, then only packages matching
+one of the specifiers will have their relationships explained\.
+.P
+The package spec can also refer to a folder within \fB\|\./node_modules\fP
.P
For example, running \fBnpm explain glob\fP within npm's source tree will show:
.P
@@ -106,6 +107,8 @@ This value is not exported to the environment for child processes\.
.SS See Also
.RS 0
.IP \(bu 2
+npm help package spec
+.IP \(bu 2
npm help config
.IP \(bu 2
npm help npmrc
diff --git a/deps/npm/man/man1/npm-fund.1 b/deps/npm/man/man1/npm-fund.1
index ef77df60ce83d5..3f48fda912c551 100644
--- a/deps/npm/man/man1/npm-fund.1
+++ b/deps/npm/man/man1/npm-fund.1
@@ -5,27 +5,27 @@
.P
.RS 2
.nf
-npm fund [[<@scope>/]]
+npm fund []
.fi
.RE
.SS Description
.P
This command retrieves information on how to fund the dependencies of a
given project\. If no package name is provided, it will list all
-dependencies that are looking for funding in a tree structure, listing the
-type of funding and the url to visit\. If a package name is provided then it
-tries to open its funding url using the \fB\-\-browser\fP config param; if there
-are multiple funding sources for the package, the user will be instructed
-to pass the \fB\-\-which\fP option to disambiguate\.
+dependencies that are looking for funding in a tree structure, listing
+the type of funding and the url to visit\. If a package name is provided
+then it tries to open its funding url using the \fB\-\-browser\fP config
+param; if there are multiple funding sources for the package, the user
+will be instructed to pass the \fB\-\-which\fP option to disambiguate\.
.P
The list will avoid duplicated entries and will stack all packages that
-share the same url as a single entry\. Thus, the list does not have the same
-shape of the output from \fBnpm ls\fP\|\.
+share the same url as a single entry\. Thus, the list does not have the
+same shape of the output from \fBnpm ls\fP\|\.
.SS Example
.SS Workspaces support
.P
-It's possible to filter the results to only include a single workspace and its
-dependencies using the \fBworkspace\fP config option\.
+It's possible to filter the results to only include a single workspace
+and its dependencies using the \fBworkspace\fP config option\.
.SS Example:
.P
Here's an example running \fBnpm fund\fP in a project with a configured
@@ -46,8 +46,8 @@ test\-workspaces\-fund@1\.0\.0
.fi
.RE
.P
-And here is an example of the expected result when filtering only by
-a specific workspace \fBa\fP in the same project:
+And here is an example of the expected result when filtering only by a
+specific workspace \fBa\fP in the same project:
.P
.RS 2
.nf
@@ -148,6 +148,8 @@ If there are multiple funding sources, which 1\-indexed source URL to open\.
.SH See Also
.RS 0
.IP \(bu 2
+npm help package spec
+.IP \(bu 2
npm help install
.IP \(bu 2
npm help docs
diff --git a/deps/npm/man/man1/npm-init.1 b/deps/npm/man/man1/npm-init.1
index 51e9f42f824c75..c49b0c7ac4cd47 100644
--- a/deps/npm/man/man1/npm-init.1
+++ b/deps/npm/man/man1/npm-init.1
@@ -5,9 +5,8 @@
.P
.RS 2
.nf
-npm init [\-\-force|\-f|\-\-yes|\-y|\-\-scope]
+npm init (same as `npx )
npm init <@scope> (same as `npx <@scope>/create`)
-npm init [<@scope>/] (same as `npx [<@scope>/]create\-`)
aliases: create, innit
.fi
@@ -232,6 +231,42 @@ Allow unpublishing of entire packages (not just a single version)\.
.P
If you don't have a clear idea of what you want to do, it is strongly
recommended that you do not use this option!
+.SS \fBscope\fP
+.RS 0
+.IP \(bu 2
+Default: the scope of the current project, if any, or ""
+.IP \(bu 2
+Type: String
+
+.RE
+.P
+Associate an operation with a scope for a scoped registry\.
+.P
+Useful when logging in to or out of a private registry:
+.P
+.RS 2
+.nf
+# log in, linking the scope to the custom registry
+npm login \-\-scope=@mycorp \-\-registry=https://registry\.mycorp\.com
+
+# log out, removing the link and the auth token
+npm logout \-\-scope=@mycorp
+.fi
+.RE
+.P
+This will cause \fB@mycorp\fP to be mapped to the registry for future
+installation of packages specified according to the pattern
+\fB@mycorp/package\fP\|\.
+.P
+This will also cause \fBnpm init\fP to create a scoped package\.
+.P
+.RS 2
+.nf
+# accept all defaults, and create a package named "@foo/whatever",
+# instead of just named "whatever"
+npm init \-\-scope=@foo \-\-yes
+.fi
+.RE
.SS \fBworkspace\fP
.RS 0
.IP \(bu 2
@@ -316,6 +351,8 @@ This value is not exported to the environment for child processes\.
.SS See Also
.RS 0
.IP \(bu 2
+npm help package spec
+.IP \(bu 2
init\-package\-json module \fIhttp://npm\.im/init\-package\-json\fR
.IP \(bu 2
npm help package\.json
diff --git a/deps/npm/man/man1/npm-install-ci-test.1 b/deps/npm/man/man1/npm-install-ci-test.1
index e50f7e90aec027..8f153e1366e240 100644
--- a/deps/npm/man/man1/npm-install-ci-test.1
+++ b/deps/npm/man/man1/npm-install-ci-test.1
@@ -67,7 +67,7 @@ Type: null or String
.RE
.P
The shell to use for scripts run with the \fBnpm exec\fP, \fBnpm run\fP and \fBnpm
-init \fP commands\.
+init \fP commands\.
.SS See Also
.RS 0
.IP \(bu 2
diff --git a/deps/npm/man/man1/npm-install-test.1 b/deps/npm/man/man1/npm-install-test.1
index 1e6ece0f47b616..02f9603e2597f8 100644
--- a/deps/npm/man/man1/npm-install-test.1
+++ b/deps/npm/man/man1/npm-install-test.1
@@ -5,16 +5,7 @@
.P
.RS 2
.nf
-npm install\-test [<@scope>/]
-npm install\-test [<@scope>/]@
-npm install\-test [<@scope>/]@
-npm install\-test [<@scope>/]@
-npm install\-test @npm:
-npm install\-test
-npm install\-test
-npm install\-test
-npm install\-test
-npm install\-test /
+npm install\-test [ \.\.\.]
alias: it
.fi
diff --git a/deps/npm/man/man1/npm-install.1 b/deps/npm/man/man1/npm-install.1
index 9d720117819769..f99ad884255373 100644
--- a/deps/npm/man/man1/npm-install.1
+++ b/deps/npm/man/man1/npm-install.1
@@ -5,16 +5,7 @@
.P
.RS 2
.nf
-npm install [<@scope>/]
-npm install [<@scope>/]@
-npm install [<@scope>/]@
-npm install [<@scope>/]@
-npm install @npm:
-npm install
-npm install
-npm install
-npm install
-npm install /
+npm install [ \.\.\.]
aliases: add, i, in, ins, inst, insta, instal, isnt, isnta, isntal, isntall
.fi
diff --git a/deps/npm/man/man1/npm-link.1 b/deps/npm/man/man1/npm-link.1
index d748d168451826..e138490e1b3301 100644
--- a/deps/npm/man/man1/npm-link.1
+++ b/deps/npm/man/man1/npm-link.1
@@ -5,8 +5,7 @@
.P
.RS 2
.nf
-npm link (in package dir)
-npm link [<@scope>/][@]
+npm link []
alias: ln
.fi
@@ -18,11 +17,11 @@ test iteratively without having to continually rebuild\.
.P
Package linking is a two\-step process\.
.P
-First, \fBnpm link\fP in a package folder will create a symlink in the global
-folder \fB{prefix}/lib/node_modules/\fP that links to the package
-where the \fBnpm link\fP command was executed\. It will also link any bins in
-the package to \fB{prefix}/bin/{name}\fP\|\. Note that \fBnpm link\fP uses the global
-prefix (see \fBnpm prefix \-g\fP for its value)\.
+First, \fBnpm link\fP in a package folder with no arguments will create a
+symlink in the global folder \fB{prefix}/lib/node_modules/\fP that
+links to the package where the \fBnpm link\fP command was executed\. It will
+also link any bins in the package to \fB{prefix}/bin/{name}\fP\|\. Note that
+\fBnpm link\fP uses the global prefix (see \fBnpm prefix \-g\fP for its value)\.
.P
Next, in some other location, \fBnpm link package\-name\fP will create a
symbolic link from globally\-installed \fBpackage\-name\fP to \fBnode_modules/\fP of
@@ -401,6 +400,8 @@ symlink\. This option has no effect on workspaces\.
.SS See Also
.RS 0
.IP \(bu 2
+npm help package spec
+.IP \(bu 2
npm help developers
.IP \(bu 2
npm help package\.json
diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1
index 2308cc16016a62..a24c524909f9ff 100644
--- a/deps/npm/man/man1/npm-ls.1
+++ b/deps/npm/man/man1/npm-ls.1
@@ -5,7 +5,7 @@
.P
.RS 2
.nf
-npm ls [[<@scope>/] \.\.\.]
+npm ls
alias: list
.fi
@@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show:
.P
.RS 2
.nf
-npm@8\.12\.1 /path/to/npm
+npm@8\.13\.1 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
@@ -301,6 +301,8 @@ symlink\. This option has no effect on workspaces\.
.SS See Also
.RS 0
.IP \(bu 2
+npm help package spec
+.IP \(bu 2
npm help explain
.IP \(bu 2
npm help config
diff --git a/deps/npm/man/man1/npm-outdated.1 b/deps/npm/man/man1/npm-outdated.1
index 3d5025e0e04335..80ec0928a2baa4 100644
--- a/deps/npm/man/man1/npm-outdated.1
+++ b/deps/npm/man/man1/npm-outdated.1
@@ -5,7 +5,7 @@
.P
.RS 2
.nf
-npm outdated [[<@scope>/] \.\.\.]
+npm outdated [ \.\.\.]
.fi
.RE
.SS Description
@@ -208,6 +208,8 @@ This value is not exported to the environment for child processes\.
.SS See Also
.RS 0
.IP \(bu 2
+npm help package spec
+.IP \(bu 2
npm help update
.IP \(bu 2
npm help dist\-tag
diff --git a/deps/npm/man/man1/npm-owner.1 b/deps/npm/man/man1/npm-owner.1
index 312bf22942d6c6..85ab4077b21bce 100644
--- a/deps/npm/man/man1/npm-owner.1
+++ b/deps/npm/man/man1/npm-owner.1
@@ -5,9 +5,9 @@
.P
.RS 2
.nf
-npm owner add [<@scope>/]
-npm owner rm [<@scope>/]
-npm owner ls [<@scope>/]
+npm owner add
+npm owner rm
+npm owner ls
alias: author
.fi
@@ -119,6 +119,8 @@ This value is not exported to the environment for child processes\.
.SS See Also
.RS 0
.IP \(bu 2
+npm help package spec
+.IP \(bu 2
npm help profile
.IP \(bu 2
npm help publish
diff --git a/deps/npm/man/man1/npm-pack.1 b/deps/npm/man/man1/npm-pack.1
index 028fab69b1af14..a46bf5c752648f 100644
--- a/deps/npm/man/man1/npm-pack.1
+++ b/deps/npm/man/man1/npm-pack.1
@@ -5,7 +5,7 @@
.P
.RS 2
.nf
-npm pack [[<@scope>/]\.\.\.]
+npm pack
.fi
.RE
.SS Configuration
@@ -138,6 +138,8 @@ If no arguments are supplied, then npm packs the current package folder\.
.SS See Also
.RS 0
.IP \(bu 2
+npm help package spec
+.IP \(bu 2
npm\-packlist package \fIhttp://npm\.im/npm\-packlist\fR
.IP \(bu 2
npm help cache
diff --git a/deps/npm/man/man1/npm-publish.1 b/deps/npm/man/man1/npm-publish.1
index dc914cf75cc4c2..d64a144447f7b2 100644
--- a/deps/npm/man/man1/npm-publish.1
+++ b/deps/npm/man/man1/npm-publish.1
@@ -5,50 +5,39 @@
.P
.RS 2
.nf
-npm publish []
+npm publish
.fi
.RE
.SS Description
.P
Publishes a package to the registry so that it can be installed by name\.
.P
-By default npm will publish to the public registry\. This can be overridden
-by specifying a different default registry or using a
-npm help \fBscope\fP in the name (see
+By default npm will publish to the public registry\. This can be
+overridden by specifying a different default registry or using a
+npm help \fBscope\fP in the name, combined with a
+scope\-configured registry (see
npm help \fBpackage\.json\fP)\.
+.P
+A \fBpackage\fP is interpreted the same way as other commands (like
+\fBnpm install\fP and can be:
.RS 0
.IP \(bu 2
-\fB\fP: A folder containing a package\.json file
-.IP \(bu 2
-\fB\fP: A url or file path to a gzipped tar archive containing a
-single folder with a package\.json file inside\.
+a) a folder containing a program described by a
+npm help \fBpackage\.json\fP file
.IP \(bu 2
-\fB[\-\-tag ]\fP: Registers the published package with the given tag, such
-that \fBnpm install @\fP will install this version\. By default,
-\fBnpm publish\fP updates and \fBnpm install\fP installs the \fBlatest\fP tag\. See
-\fBnpm\-dist\-tag\fP \fInpm\-dist\-tag\fR for details about tags\.
+b) a gzipped tarball containing (a)
.IP \(bu 2
-\fB[\-\-access ]\fP: Tells the registry whether this package
-should be published as public or restricted\. Only applies to scoped
-packages, which default to \fBrestricted\fP\|\. If you don't have a paid
-account, you must publish with \fB\-\-access public\fP to publish scoped
-packages\.
+c) a url that resolves to (b)
.IP \(bu 2
-\fB[\-\-otp ]\fP: If you have two\-factor authentication enabled in
-\fBauth\-and\-writes\fP mode then you can provide a code from your
-authenticator with this\. If you don't include this and you're running
-from a TTY then you'll be prompted\.
+d) a \fB@\fP that is published on the registry (see
+npm help \fBregistry\fP) with (c)
.IP \(bu 2
-\fB[\-\-dry\-run]\fP: As of \fBnpm@6\fP, does everything publish would do except
-actually publishing to the registry\. Reports the details of what would
-have been published\.
+e) a \fB@\fP (see npm help \fBdist\-tag\fP) that
+points to (d)
.IP \(bu 2
-\fB[\-\-workspaces]\fP: Enables workspace context while publishing\. All
-workspace packages will be published\.
+f) a \fB\fP that has a "latest" tag satisfying (e)
.IP \(bu 2
-\fB[\-\-workspace]\fP: Enables workspaces context and limits results to only
-those specified by this config item\. Only the packages in the
-workspaces given will be published\.
+g) a \fB\fP that resolves to (a)
.RE
.P
@@ -241,6 +230,8 @@ This value is not exported to the environment for child processes\.
.SS See Also
.RS 0
.IP \(bu 2
+npm help package spec
+.IP \(bu 2
npm\-packlist package \fIhttp://npm\.im/npm\-packlist\fR
.IP \(bu 2
npm help registry
diff --git a/deps/npm/man/man1/npm-rebuild.1 b/deps/npm/man/man1/npm-rebuild.1
index 8d6d90b10f0871..f4e4c56118d292 100644
--- a/deps/npm/man/man1/npm-rebuild.1
+++ b/deps/npm/man/man1/npm-rebuild.1
@@ -5,7 +5,7 @@
.P
.RS 2
.nf
-npm rebuild [[<@scope>/][@] \.\.\.]
+npm rebuild [] \.\.\.]
alias: rb
.fi
@@ -18,9 +18,8 @@ C++ addons with the new binary\. It is also useful when installing with
\fB\-\-ignore\-scripts\fP and \fB\-\-no\-bin\-links\fP, to explicitly choose which
packages to build and/or link bins\.
.P
-If one or more package names (and optionally version ranges) are provided,
-then only packages with a name and version matching one of the specifiers
-will be rebuilt\.
+If one or more package specs are provided, then only packages with a
+name and version matching one of the specifiers will be rebuilt\.
.SS Configuration
.SS \fBglobal\fP
.RS 0
@@ -174,6 +173,8 @@ symlink\. This option has no effect on workspaces\.
.SS See Also
.RS 0
.IP \(bu 2
+npm help package spec
+.IP \(bu 2
npm help install
.RE
diff --git a/deps/npm/man/man1/npm-restart.1 b/deps/npm/man/man1/npm-restart.1
index 2f99ee51ed4fc1..460a94350f1bd9 100644
--- a/deps/npm/man/man1/npm-restart.1
+++ b/deps/npm/man/man1/npm-restart.1
@@ -72,7 +72,7 @@ Type: null or String
.RE
.P
The shell to use for scripts run with the \fBnpm exec\fP, \fBnpm run\fP and \fBnpm
-init \fP commands\.
+init \fP commands\.
.SS See Also
.RS 0
.IP \(bu 2
diff --git a/deps/npm/man/man1/npm-run-script.1 b/deps/npm/man/man1/npm-run-script.1
index fc26c71e0310f9..c9dc22f4eb6bd4 100644
--- a/deps/npm/man/man1/npm-run-script.1
+++ b/deps/npm/man/man1/npm-run-script.1
@@ -256,7 +256,7 @@ Type: null or String
.RE
.P
The shell to use for scripts run with the \fBnpm exec\fP, \fBnpm run\fP and \fBnpm
-init \fP commands\.
+init \fP commands\.
.SS See Also
.RS 0
.IP \(bu 2
diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1
index 2ccd4046e42d7e..2e91f78bdc9ca8 100644
--- a/deps/npm/man/man1/npm-star.1
+++ b/deps/npm/man/man1/npm-star.1
@@ -5,7 +5,7 @@
.P
.RS 2
.nf
-npm star [\.\.\.]
+npm star [\.\.\.]
.fi
.RE
.P
@@ -67,6 +67,8 @@ password, npm will prompt on the command line for one\.
.SS See Also
.RS 0
.IP \(bu 2
+npm help package spec
+.IP \(bu 2
npm help unstar
.IP \(bu 2
npm help stars
diff --git a/deps/npm/man/man1/npm-start.1 b/deps/npm/man/man1/npm-start.1
index 589ecea4a240a7..af45de89f3f5d3 100644
--- a/deps/npm/man/man1/npm-start.1
+++ b/deps/npm/man/man1/npm-start.1
@@ -71,7 +71,7 @@ Type: null or String
.RE
.P
The shell to use for scripts run with the \fBnpm exec\fP, \fBnpm run\fP and \fBnpm
-init \fP commands\.
+init \fP commands\.
.SS See Also
.RS 0
.IP \(bu 2
diff --git a/deps/npm/man/man1/npm-stop.1 b/deps/npm/man/man1/npm-stop.1
index 19695cc0e04174..f1159699a3bbca 100644
--- a/deps/npm/man/man1/npm-stop.1
+++ b/deps/npm/man/man1/npm-stop.1
@@ -64,7 +64,7 @@ Type: null or String
.RE
.P
The shell to use for scripts run with the \fBnpm exec\fP, \fBnpm run\fP and \fBnpm
-init \fP commands\.
+init \fP commands\.
.SS See Also
.RS 0
.IP \(bu 2
diff --git a/deps/npm/man/man1/npm-test.1 b/deps/npm/man/man1/npm-test.1
index fbbe80d2638e40..8dd0f2f6828b00 100644
--- a/deps/npm/man/man1/npm-test.1
+++ b/deps/npm/man/man1/npm-test.1
@@ -61,7 +61,7 @@ Type: null or String
.RE
.P
The shell to use for scripts run with the \fBnpm exec\fP, \fBnpm run\fP and \fBnpm
-init \fP commands\.
+init \fP commands\.
.SS See Also
.RS 0
.IP \(bu 2
diff --git a/deps/npm/man/man1/npm-unpublish.1 b/deps/npm/man/man1/npm-unpublish.1
index ff538299e7c355..57ba85fb432522 100644
--- a/deps/npm/man/man1/npm-unpublish.1
+++ b/deps/npm/man/man1/npm-unpublish.1
@@ -5,7 +5,7 @@
.P
.RS 2
.nf
-npm unpublish [<@scope>/][@]
+npm unpublish []
.fi
.RE
.P
@@ -149,6 +149,8 @@ This value is not exported to the environment for child processes\.
.SS See Also
.RS 0
.IP \(bu 2
+npm help package spec
+.IP \(bu 2
npm help deprecate
.IP \(bu 2
npm help publish
diff --git a/deps/npm/man/man1/npm-unstar.1 b/deps/npm/man/man1/npm-unstar.1
index d71bfff266b312..b3ece049f9bb53 100644
--- a/deps/npm/man/man1/npm-unstar.1
+++ b/deps/npm/man/man1/npm-unstar.1
@@ -5,7 +5,7 @@
.P
.RS 2
.nf
-npm unstar [\.\.\.]
+npm unstar [\.\.\.]
.fi
.RE
.P
diff --git a/deps/npm/man/man1/npm-view.1 b/deps/npm/man/man1/npm-view.1
index efba9ebd6bd696..7f83d89bf67b74 100644
--- a/deps/npm/man/man1/npm-view.1
+++ b/deps/npm/man/man1/npm-view.1
@@ -5,7 +5,7 @@
.P
.RS 2
.nf
-npm view [<@scope>/][@] [[\.subfield]\.\.\.]
+npm view [] [[\.subfield]\.\.\.]
aliases: info, show, v
.fi
@@ -216,6 +216,8 @@ the field name\.
.SS See Also
.RS 0
.IP \(bu 2
+npm help package spec
+.IP \(bu 2
npm help search
.IP \(bu 2
npm help registry
diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1
index 45db3c9e53776e..a26c713a11000f 100644
--- a/deps/npm/man/man1/npm.1
+++ b/deps/npm/man/man1/npm.1
@@ -4,7 +4,7 @@
.SS Synopsis
.SS Version
.P
-8\.12\.1
+8\.13\.1
.SS Description
.P
npm is the package manager for the Node JavaScript platform\. It puts
diff --git a/deps/npm/man/man5/package-json.5 b/deps/npm/man/man5/package-json.5
index 17c4c1e322c6b1..f6477ebc015c05 100644
--- a/deps/npm/man/man5/package-json.5
+++ b/deps/npm/man/man5/package-json.5
@@ -246,7 +246,7 @@ Both email and url are optional either way\.
npm also sets a top\-level "maintainers" field with your npm user info\.
.SS funding
.P
-You can specify an object containing an URL that provides up\-to\-date
+You can specify an object containing a URL that provides up\-to\-date
information about ways to help fund development of your package, or a
string URL, or an array of these:
.P
diff --git a/deps/npm/man/man7/config.7 b/deps/npm/man/man7/config.7
index 70f6742b10ada1..a64db0ae281ea8 100644
--- a/deps/npm/man/man7/config.7
+++ b/deps/npm/man/man7/config.7
@@ -1592,7 +1592,7 @@ Type: null or String
.RE
.P
The shell to use for scripts run with the \fBnpm exec\fP, \fBnpm run\fP and \fBnpm
-init \fP commands\.
+init \fP commands\.
.SS \fBsearchexclude\fP
.RS 0
.IP \(bu 2
diff --git a/deps/npm/man/man7/package-spec.7 b/deps/npm/man/man7/package-spec.7
new file mode 100644
index 00000000000000..f86a00686b0c3f
--- /dev/null
+++ b/deps/npm/man/man7/package-spec.7
@@ -0,0 +1,145 @@
+.TH "PACKAGE\-SPEC" "7" "June 2022" "" ""
+.SH "NAME"
+\fBpackage-spec\fR \- Package name specifier
+.SS Description
+.P
+Commands like \fBnpm install\fP and the dependency sections in the
+\fBpackage\.json\fP use a package name specifier\. This can be many different
+things that all refer to a "package"\. Examples include a package name,
+git url, tarball, or local directory\. These will generally be referred
+to as \fB\fP in the help output for the npm commands that use
+this package name specifier\.
+.SS Package name
+.RS 0
+.IP \(bu 2
+\fB[<@scope>/]\fP
+.IP \(bu 2
+\fB[<@scope>/]@\fP
+.IP \(bu 2
+\fB[<@scope>/]@\fP
+.IP \(bu 2
+\fB[<@scope>/]@\fP
+
+.RE
+.P
+Refers to a package by name, with or without a scope, and optionally
+tag, version, or version range\. This is typically used in combination
+with the npm help registry config to refer to a
+package in a registry\.
+.P
+Examples:
+.RS 0
+.IP \(bu 2
+\fBnpm\fP
+.IP \(bu 2
+\fB@npmcli/arborist\fP
+.IP \(bu 2
+\fB@npmcli/arborist@latest\fP
+.IP \(bu 2
+\fBnpm@6\.13\.1\fP
+.IP \(bu 2
+\fBnpm@^4\.0\.0\fP
+
+.RE
+.SS Aliases
+.RS 0
+.IP \(bu 2
+\fB@npm:\fP
+
+.RE
+.P
+Primarily used by commands like \fBnpm install\fP and in the dependency
+sections in the \fBpackage\.json\fP, this refers to a package by an alias\.
+The \fB\fP is the name of the package as it is reified in the
+\fBnode_modules\fP folder, and the \fB\fP refers to a package name as
+found in the configured registry\.
+.P
+See \fBPackage name\fP above for more info on referring to a package by
+name, and npm help registry for configuring which
+registry is used when referring to a package by name\.
+.P
+Examples:
+.RS 0
+.IP \(bu 2
+\fBsemver:@npm:@npmcli/semver\-with\-patch\fP
+.IP \(bu 2
+\fBsemver:@npm:semver@7\.2\.2\fP
+.IP \(bu 2
+\fBsemver:@npm:semver@legacy\fP
+
+.RE
+.SS Folders
+.RS 0
+.IP \(bu 2
+\fB\fP
+
+.RE
+.P
+This refers to a package on the local filesystem\. Specifically this is
+a folder with a \fBpackage\.json\fP file in it\. This \fIshould\fR always be
+prefixed with a \fB/\fP or \fB\|\./\fP (or your OS equivalent) to reduce confusion\.
+npm currently will parse a string with more than one \fB/\fP in it as a
+folder, but this is legacy behavior that may be removed in a future
+version\.
+.P
+Examples:
+.RS 0
+.IP \(bu 2
+\fB\|\./my\-package\fP
+.IP \(bu 2
+\fB/opt/npm/my\-package\fP
+
+.RE
+.SS Tarballs
+.RS 0
+.IP \(bu 2
+\fB\fP
+.IP \(bu 2
+\fB\fP
+
+.RE
+.P
+Examples:
+.RS 0
+.IP \(bu 2
+\fB\|\./my\-package\.tgz\fP
+.IP \(bu 2
+\fBhttps://registry\.npmjs\.org/semver/\-/semver\-1\.0\.0\.tgz\fP
+
+.RE
+.P
+Refers to a package in a tarball format, either on the local filesystem
+or remotely via url\. This is the format that packages exist in when
+uploaded to a registry\.
+.SS git urls
+.RS 0
+.IP \(bu 2
+\fB\fP
+.IP \(bu 2
+\fB/