mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
deps: upgrade npm to 10.8.0
PR-URL: https://github.com/nodejs/node/pull/53014 Reviewed-By: Luke Karrys <luke@lukekarrys.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
1 parent
badec0c38b
commit
fd91eaab34
361 files changed
+5924
-3994
No files matched your search
+1
-1
@@ -27,7 +27,7 @@ packages will *also* show the paths to the specified packages. For
|
||||
example, running `npm ls promzard` in npm's source tree will show:
|
||||
|
||||
```bash
|
||||
npm@10.7.0 /path/to/npm
|
||||
npm@10.8.0 /path/to/npm
|
||||
└─┬ init-package-json@0.0.4
|
||||
└── promzard@0.1.5
|
||||
```
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ Note: This command is unaware of workspaces.
|
||||
|
||||
### Version
|
||||
|
||||
10.7.0
|
||||
10.8.0
|
||||
|
||||
### Description
|
||||
|
||||
|
||||
+9
-13
@@ -368,7 +368,7 @@ For example, myapp could have this:
|
||||
```json
|
||||
{
|
||||
"bin": {
|
||||
"myapp": "./cli.js"
|
||||
"myapp": "bin/cli.js"
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -385,7 +385,7 @@ package, then you can just supply it as a string. For example:
|
||||
{
|
||||
"name": "my-program",
|
||||
"version": "1.2.5",
|
||||
"bin": "./path/to/program"
|
||||
"bin": "path/to/program"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -396,7 +396,7 @@ would be the same as this:
|
||||
"name": "my-program",
|
||||
"version": "1.2.5",
|
||||
"bin": {
|
||||
"my-program": "./path/to/program"
|
||||
"my-program": "path/to/program"
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -497,7 +497,7 @@ walking the folder.
|
||||
### repository
|
||||
|
||||
Specify the place where your code lives. This is helpful for people who
|
||||
want to contribute. If the git repo is on GitHub, then the `npm docs`
|
||||
want to contribute. If the git repo is on GitHub, then the `npm repo`
|
||||
command will be able to find you.
|
||||
|
||||
Do it like this:
|
||||
@@ -818,11 +818,12 @@ to express this. If you depend on features introduced in 1.5.2, use
|
||||
|
||||
### peerDependenciesMeta
|
||||
|
||||
When a user installs your package, npm will emit warnings if packages
|
||||
specified in `peerDependencies` are not already installed. The
|
||||
`peerDependenciesMeta` field serves to provide npm more information on how
|
||||
The `peerDependenciesMeta` field serves to provide npm more information on how
|
||||
your peer dependencies are to be used. Specifically, it allows peer
|
||||
dependencies to be marked as optional.
|
||||
dependencies to be marked as optional. Npm will not automatically install
|
||||
optional peer dependencies. This allows you to
|
||||
integrate and interact with a variety of host packages without requiring
|
||||
all of them to be installed.
|
||||
|
||||
For example:
|
||||
|
||||
@@ -842,11 +843,6 @@ For example:
|
||||
}
|
||||
```
|
||||
|
||||
Marking a peer dependency as optional ensures npm will not emit a warning
|
||||
if the `soy-milk` package is not installed on the host. This allows you to
|
||||
integrate and interact with a variety of host packages without requiring
|
||||
all of them to be installed.
|
||||
|
||||
### bundleDependencies
|
||||
|
||||
This defines an array of package names that will be bundled when publishing
|
||||
|
||||
+1
-1
@@ -1217,7 +1217,7 @@ a semver. Like the `rc` in `1.2.0-rc.8`.
|
||||
* Type: Boolean
|
||||
|
||||
When set to `true`, npm will display a progress bar during time intensive
|
||||
operations, if `process.stderr` is a TTY.
|
||||
operations, if `process.stderr` and `process.stdout` are a TTY.
|
||||
|
||||
Set to `false` to suppress the progress bar.
|
||||
|
||||
|
||||
+1
-5
@@ -12,11 +12,7 @@ So sad to see you go.
|
||||
sudo npm uninstall npm -g
|
||||
```
|
||||
|
||||
Or, if that fails, get the npm source code, and do:
|
||||
|
||||
```bash
|
||||
sudo make uninstall
|
||||
```
|
||||
Or, if that fails, please proceed to more severe uninstalling methods.
|
||||
|
||||
### More Severe Uninstalling
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -157,7 +157,7 @@ const replaceHelpLinks = (src) => {
|
||||
|
||||
const transformMan = (src, { data, unified, remarkParse, remarkMan }) => unified()
|
||||
.use(remarkParse)
|
||||
.use(remarkMan)
|
||||
.use(remarkMan, { version: `NPM@${version}` })
|
||||
.processSync(`# ${data.title}(${data.section}) - ${data.description}\n\n${src}`)
|
||||
.toString()
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-access">npm-access</h1>
|
||||
<h1 id="----npm-access----1080">
|
||||
<span>npm-access</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Set access level on published packages</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-adduser">npm-adduser</h1>
|
||||
<h1 id="----npm-adduser----1080">
|
||||
<span>npm-adduser</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Add a registry user account</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-audit">npm-audit</h1>
|
||||
<h1 id="----npm-audit----1080">
|
||||
<span>npm-audit</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Run a security audit</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-bugs">npm-bugs</h1>
|
||||
<h1 id="----npm-bugs----1080">
|
||||
<span>npm-bugs</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Report bugs for a package in a web browser</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-cache">npm-cache</h1>
|
||||
<h1 id="----npm-cache----1080">
|
||||
<span>npm-cache</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Manipulates packages cache</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-ci">npm-ci</h1>
|
||||
<h1 id="----npm-ci----1080">
|
||||
<span>npm-ci</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Clean install a project</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-completion">npm-completion</h1>
|
||||
<h1 id="----npm-completion----1080">
|
||||
<span>npm-completion</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Tab Completion for npm</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-config">npm-config</h1>
|
||||
<h1 id="----npm-config----1080">
|
||||
<span>npm-config</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Manage the npm configuration files</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-dedupe">npm-dedupe</h1>
|
||||
<h1 id="----npm-dedupe----1080">
|
||||
<span>npm-dedupe</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Reduce duplication in the package tree</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-deprecate">npm-deprecate</h1>
|
||||
<h1 id="----npm-deprecate----1080">
|
||||
<span>npm-deprecate</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Deprecate a version of a package</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-diff">npm-diff</h1>
|
||||
<h1 id="----npm-diff----1080">
|
||||
<span>npm-diff</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">The registry diff command</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-dist-tag">npm-dist-tag</h1>
|
||||
<h1 id="----npm-dist-tag----1080">
|
||||
<span>npm-dist-tag</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Modify package distribution tags</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-docs">npm-docs</h1>
|
||||
<h1 id="----npm-docs----1080">
|
||||
<span>npm-docs</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Open documentation for a package in a web browser</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-doctor">npm-doctor</h1>
|
||||
<h1 id="----npm-doctor----1080">
|
||||
<span>npm-doctor</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Check the health of your npm environment</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-edit">npm-edit</h1>
|
||||
<h1 id="----npm-edit----1080">
|
||||
<span>npm-edit</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Edit an installed package</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-exec">npm-exec</h1>
|
||||
<h1 id="----npm-exec----1080">
|
||||
<span>npm-exec</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Run a command from a local or remote npm package</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-explain">npm-explain</h1>
|
||||
<h1 id="----npm-explain----1080">
|
||||
<span>npm-explain</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Explain installed packages</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-explore">npm-explore</h1>
|
||||
<h1 id="----npm-explore----1080">
|
||||
<span>npm-explore</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Browse an installed package</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-find-dupes">npm-find-dupes</h1>
|
||||
<h1 id="----npm-find-dupes----1080">
|
||||
<span>npm-find-dupes</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Find duplication in the package tree</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-fund">npm-fund</h1>
|
||||
<h1 id="----npm-fund----1080">
|
||||
<span>npm-fund</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Retrieve funding information</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-help-search">npm-help-search</h1>
|
||||
<h1 id="----npm-help-search----1080">
|
||||
<span>npm-help-search</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Search npm help documentation</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-help">npm-help</h1>
|
||||
<h1 id="----npm-help----1080">
|
||||
<span>npm-help</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Get help on npm</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-hook">npm-hook</h1>
|
||||
<h1 id="----npm-hook----1080">
|
||||
<span>npm-hook</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Manage registry hooks</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-init">npm-init</h1>
|
||||
<h1 id="----npm-init----1080">
|
||||
<span>npm-init</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Create a package.json file</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-install-ci-test">npm-install-ci-test</h1>
|
||||
<h1 id="----npm-install-ci-test----1080">
|
||||
<span>npm-install-ci-test</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Install a project with a clean slate and run tests</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-install-test">npm-install-test</h1>
|
||||
<h1 id="----npm-install-test----1080">
|
||||
<span>npm-install-test</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Install package(s) and run tests</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-install">npm-install</h1>
|
||||
<h1 id="----npm-install----1080">
|
||||
<span>npm-install</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Install a package</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-link">npm-link</h1>
|
||||
<h1 id="----npm-link----1080">
|
||||
<span>npm-link</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Symlink a package folder</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-login">npm-login</h1>
|
||||
<h1 id="----npm-login----1080">
|
||||
<span>npm-login</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Login to a registry user account</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-logout">npm-logout</h1>
|
||||
<h1 id="----npm-logout----1080">
|
||||
<span>npm-logout</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Log out of the registry</span>
|
||||
</header>
|
||||
|
||||
|
||||
+10
-2
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-ls">npm-ls</h1>
|
||||
<h1 id="----npm-ls----1080">
|
||||
<span>npm-ls</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">List installed packages</span>
|
||||
</header>
|
||||
|
||||
@@ -160,7 +168,7 @@ tree at all, use <a href="../commands/npm-explain.html"><code>npm explain</code>
|
||||
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's source tree will show:</p>
|
||||
<pre><code class="language-bash">npm@10.7.0 /path/to/npm
|
||||
<pre><code class="language-bash">npm@10.8.0 /path/to/npm
|
||||
└─┬ init-package-json@0.0.4
|
||||
└── promzard@0.1.5
|
||||
</code></pre>
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-org">npm-org</h1>
|
||||
<h1 id="----npm-org----1080">
|
||||
<span>npm-org</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Manage orgs</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-outdated">npm-outdated</h1>
|
||||
<h1 id="----npm-outdated----1080">
|
||||
<span>npm-outdated</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Check for outdated packages</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-owner">npm-owner</h1>
|
||||
<h1 id="----npm-owner----1080">
|
||||
<span>npm-owner</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Manage package owners</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-pack">npm-pack</h1>
|
||||
<h1 id="----npm-pack----1080">
|
||||
<span>npm-pack</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Create a tarball from a package</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-ping">npm-ping</h1>
|
||||
<h1 id="----npm-ping----1080">
|
||||
<span>npm-ping</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Ping npm registry</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-pkg">npm-pkg</h1>
|
||||
<h1 id="----npm-pkg----1080">
|
||||
<span>npm-pkg</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Manages your package.json</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-prefix">npm-prefix</h1>
|
||||
<h1 id="----npm-prefix----1080">
|
||||
<span>npm-prefix</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Display prefix</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-profile">npm-profile</h1>
|
||||
<h1 id="----npm-profile----1080">
|
||||
<span>npm-profile</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Change settings on your registry profile</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-prune">npm-prune</h1>
|
||||
<h1 id="----npm-prune----1080">
|
||||
<span>npm-prune</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Remove extraneous packages</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-publish">npm-publish</h1>
|
||||
<h1 id="----npm-publish----1080">
|
||||
<span>npm-publish</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Publish a package</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-query">npm-query</h1>
|
||||
<h1 id="----npm-query----1080">
|
||||
<span>npm-query</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Dependency selector query</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-rebuild">npm-rebuild</h1>
|
||||
<h1 id="----npm-rebuild----1080">
|
||||
<span>npm-rebuild</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Rebuild a package</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-repo">npm-repo</h1>
|
||||
<h1 id="----npm-repo----1080">
|
||||
<span>npm-repo</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Open package repository page in the browser</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-restart">npm-restart</h1>
|
||||
<h1 id="----npm-restart----1080">
|
||||
<span>npm-restart</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Restart a package</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-root">npm-root</h1>
|
||||
<h1 id="----npm-root----1080">
|
||||
<span>npm-root</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Display npm root</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-run-script">npm-run-script</h1>
|
||||
<h1 id="----npm-run-script----1080">
|
||||
<span>npm-run-script</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Run arbitrary package scripts</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-sbom">npm-sbom</h1>
|
||||
<h1 id="----npm-sbom----1080">
|
||||
<span>npm-sbom</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Generate a Software Bill of Materials (SBOM)</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-search">npm-search</h1>
|
||||
<h1 id="----npm-search----1080">
|
||||
<span>npm-search</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Search for packages</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-shrinkwrap">npm-shrinkwrap</h1>
|
||||
<h1 id="----npm-shrinkwrap----1080">
|
||||
<span>npm-shrinkwrap</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Lock down dependency versions for publication</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-star">npm-star</h1>
|
||||
<h1 id="----npm-star----1080">
|
||||
<span>npm-star</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Mark your favorite packages</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-stars">npm-stars</h1>
|
||||
<h1 id="----npm-stars----1080">
|
||||
<span>npm-stars</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">View packages marked as favorites</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-start">npm-start</h1>
|
||||
<h1 id="----npm-start----1080">
|
||||
<span>npm-start</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Start a package</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-stop">npm-stop</h1>
|
||||
<h1 id="----npm-stop----1080">
|
||||
<span>npm-stop</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Stop a package</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-team">npm-team</h1>
|
||||
<h1 id="----npm-team----1080">
|
||||
<span>npm-team</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Manage organization teams and team memberships</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-test">npm-test</h1>
|
||||
<h1 id="----npm-test----1080">
|
||||
<span>npm-test</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Test a package</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-token">npm-token</h1>
|
||||
<h1 id="----npm-token----1080">
|
||||
<span>npm-token</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Manage your authentication tokens</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-uninstall">npm-uninstall</h1>
|
||||
<h1 id="----npm-uninstall----1080">
|
||||
<span>npm-uninstall</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Remove a package</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-unpublish">npm-unpublish</h1>
|
||||
<h1 id="----npm-unpublish----1080">
|
||||
<span>npm-unpublish</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Remove a package from the registry</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-unstar">npm-unstar</h1>
|
||||
<h1 id="----npm-unstar----1080">
|
||||
<span>npm-unstar</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Remove an item from your favorite packages</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-update">npm-update</h1>
|
||||
<h1 id="----npm-update----1080">
|
||||
<span>npm-update</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Update packages</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-version">npm-version</h1>
|
||||
<h1 id="----npm-version----1080">
|
||||
<span>npm-version</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Bump a package version</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-view">npm-view</h1>
|
||||
<h1 id="----npm-view----1080">
|
||||
<span>npm-view</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">View registry info</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-whoami">npm-whoami</h1>
|
||||
<h1 id="----npm-whoami----1080">
|
||||
<span>npm-whoami</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Display npm username</span>
|
||||
</header>
|
||||
|
||||
|
||||
+10
-2
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm">npm</h1>
|
||||
<h1 id="----npm----1080">
|
||||
<span>npm</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">javascript package manager</span>
|
||||
</header>
|
||||
|
||||
@@ -150,7 +158,7 @@ npm command-line interface
|
||||
</code></pre>
|
||||
<p>Note: This command is unaware of workspaces.</p>
|
||||
<h3 id="version">Version</h3>
|
||||
<p>10.7.0</p>
|
||||
<p>10.8.0</p>
|
||||
<h3 id="description">Description</h3>
|
||||
<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
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npx">npx</h1>
|
||||
<h1 id="----npx----1080">
|
||||
<span>npx</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Run a command from a local or remote npm package</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="folders">folders</h1>
|
||||
<h1 id="----folders----1080">
|
||||
<span>folders</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Folder Structures Used by npm</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="install">install</h1>
|
||||
<h1 id="----install----1080">
|
||||
<span>install</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Download and install node and npm</span>
|
||||
</header>
|
||||
|
||||
|
||||
@@ -0,0 +1,330 @@
|
||||
<!DOCTYPE html><html><head>
|
||||
<meta charset="utf-8">
|
||||
<title>folders</title>
|
||||
<style>
|
||||
body {
|
||||
background-color: #ffffff;
|
||||
color: #24292e;
|
||||
|
||||
margin: 0;
|
||||
|
||||
line-height: 1.5;
|
||||
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
|
||||
}
|
||||
#rainbar {
|
||||
height: 10px;
|
||||
background-image: linear-gradient(139deg, #fb8817, #ff4b01, #c12127, #e02aff);
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #0366d6;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
pre {
|
||||
margin: 1em 0px;
|
||||
padding: 1em;
|
||||
border: solid 1px #e1e4e8;
|
||||
border-radius: 6px;
|
||||
|
||||
display: block;
|
||||
overflow: auto;
|
||||
|
||||
white-space: pre;
|
||||
|
||||
background-color: #f6f8fa;
|
||||
color: #393a34;
|
||||
}
|
||||
code {
|
||||
font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
||||
font-size: 85%;
|
||||
padding: 0.2em 0.4em;
|
||||
background-color: #f6f8fa;
|
||||
color: #393a34;
|
||||
}
|
||||
pre > code {
|
||||
padding: 0;
|
||||
background-color: inherit;
|
||||
color: inherit;
|
||||
}
|
||||
h1, h2, h3 {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
#logobar {
|
||||
background-color: #333333;
|
||||
margin: 0 auto;
|
||||
padding: 1em 4em;
|
||||
}
|
||||
#logobar .logo {
|
||||
float: left;
|
||||
}
|
||||
#logobar .title {
|
||||
font-weight: 600;
|
||||
color: #dddddd;
|
||||
float: left;
|
||||
margin: 5px 0 0 1em;
|
||||
}
|
||||
#logobar:after {
|
||||
content: "";
|
||||
display: block;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#content {
|
||||
margin: 0 auto;
|
||||
padding: 0 4em;
|
||||
}
|
||||
|
||||
#table_of_contents > h2 {
|
||||
font-size: 1.17em;
|
||||
}
|
||||
#table_of_contents ul:first-child {
|
||||
border: solid 1px #e1e4e8;
|
||||
border-radius: 6px;
|
||||
padding: 1em;
|
||||
background-color: #f6f8fa;
|
||||
color: #393a34;
|
||||
}
|
||||
#table_of_contents ul {
|
||||
list-style-type: none;
|
||||
padding-left: 1.5em;
|
||||
}
|
||||
#table_of_contents li {
|
||||
font-size: 0.9em;
|
||||
}
|
||||
#table_of_contents li a {
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
header.title {
|
||||
border-bottom: solid 1px #e1e4e8;
|
||||
}
|
||||
header.title > h1 {
|
||||
margin-bottom: 0.25em;
|
||||
}
|
||||
header.title > .description {
|
||||
display: block;
|
||||
margin-bottom: 0.5em;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
padding-top: 2em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="banner">
|
||||
<div id="rainbar"></div>
|
||||
<div id="logobar">
|
||||
<svg class="logo" role="img" height="32" width="32" viewBox="0 0 700 700">
|
||||
<polygon fill="#cb0000" points="0,700 700,700 700,0 0,0"></polygon>
|
||||
<polygon fill="#ffffff" points="150,550 350,550 350,250 450,250 450,550 550,550 550,150 150,150"></polygon>
|
||||
</svg>
|
||||
<div class="title">
|
||||
npm command-line interface
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="----folders----1080">
|
||||
<span>folders</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Folder Structures Used by npm</span>
|
||||
</header>
|
||||
|
||||
<section id="table_of_contents">
|
||||
<h2 id="table-of-contents">Table of contents</h2>
|
||||
<div id="_table_of_contents"><ul><li><a href="#description">Description</a></li><ul><li><a href="#tldr">tl;dr</a></li><li><a href="#prefix-configuration">prefix Configuration</a></li><li><a href="#node-modules">Node Modules</a></li><li><a href="#executables">Executables</a></li><li><a href="#man-pages">Man Pages</a></li><li><a href="#cache">Cache</a></li><li><a href="#temp-files">Temp Files</a></li></ul><li><a href="#more-information">More Information</a></li><ul><li><a href="#global-installation">Global Installation</a></li><li><a href="#cycles-conflicts-and-folder-parsimony">Cycles, Conflicts, and Folder Parsimony</a></li><li><a href="#example">Example</a></li><li><a href="#publishing">Publishing</a></li></ul><li><a href="#see-also">See also</a></li></ul></div>
|
||||
</section>
|
||||
|
||||
<div id="_content"><h3 id="description">Description</h3>
|
||||
<p>npm puts various things on your computer. That's its job.</p>
|
||||
<p>This document will tell you what it puts where.</p>
|
||||
<h4 id="tldr">tl;dr</h4>
|
||||
<ul>
|
||||
<li>Local install (default): puts stuff in <code>./node_modules</code> of the current
|
||||
package root.</li>
|
||||
<li>Global install (with <code>-g</code>): puts stuff in /usr/local or wherever node
|
||||
is installed.</li>
|
||||
<li>Install it <strong>locally</strong> if you're going to <code>require()</code> it.</li>
|
||||
<li>Install it <strong>globally</strong> if you're going to run it on the command line.</li>
|
||||
<li>If you need both, then install it in both places, or use <code>npm link</code>.</li>
|
||||
</ul>
|
||||
<h4 id="prefix-configuration">prefix Configuration</h4>
|
||||
<p>The <a href="../using-npm/config#prefix.html"><code>prefix</code> config</a> defaults to the location where
|
||||
node is installed. On most systems, this is <code>/usr/local</code>. On Windows, it's
|
||||
<code>%AppData%\npm</code>. On Unix systems, it's one level up, since node is typically
|
||||
installed at <code>{prefix}/bin/node</code> rather than <code>{prefix}/node.exe</code>.</p>
|
||||
<p>When the <code>global</code> flag is set, npm installs things into this prefix.
|
||||
When it is not set, it uses the root of the current package, or the
|
||||
current working directory if not in a package already.</p>
|
||||
<h4 id="node-modules">Node Modules</h4>
|
||||
<p>Packages are dropped into the <code>node_modules</code> folder under the <code>prefix</code>.
|
||||
When installing locally, this means that you can
|
||||
<code>require("packagename")</code> to load its main module, or
|
||||
<code>require("packagename/lib/path/to/sub/module")</code> to load other modules.</p>
|
||||
<p>Global installs on Unix systems go to <code>{prefix}/lib/node_modules</code>.
|
||||
Global installs on Windows go to <code>{prefix}/node_modules</code> (that is, no
|
||||
<code>lib</code> folder.)</p>
|
||||
<p>Scoped packages are installed the same way, except they are grouped together
|
||||
in a sub-folder of the relevant <code>node_modules</code> folder with the name of that
|
||||
scope prefix by the @ symbol, e.g. <code>npm install @myorg/package</code> would place
|
||||
the package in <code>{prefix}/node_modules/@myorg/package</code>. See
|
||||
<a href="../using-npm/scope.html"><code>scope</code></a> for more details.</p>
|
||||
<p>If you wish to <code>require()</code> a package, then install it locally.</p>
|
||||
<h4 id="executables">Executables</h4>
|
||||
<p>When in global mode, executables are linked into <code>{prefix}/bin</code> on Unix,
|
||||
or directly into <code>{prefix}</code> on Windows. Ensure that path is in your
|
||||
terminal's <code>PATH</code> environment to run them.</p>
|
||||
<p>When in local mode, executables are linked into
|
||||
<code>./node_modules/.bin</code> so that they can be made available to scripts run
|
||||
through npm. (For example, so that a test runner will be in the path
|
||||
when you run <code>npm test</code>.)</p>
|
||||
<h4 id="man-pages">Man Pages</h4>
|
||||
<p>When in global mode, man pages are linked into <code>{prefix}/share/man</code>.</p>
|
||||
<p>When in local mode, man pages are not installed.</p>
|
||||
<p>Man pages are not installed on Windows systems.</p>
|
||||
<h4 id="cache">Cache</h4>
|
||||
<p>See <a href="../commands/npm-cache.html"><code>npm cache</code></a>. Cache files are stored in <code>~/.npm</code> on Posix, or
|
||||
<code>%LocalAppData%/npm-cache</code> on Windows.</p>
|
||||
<p>This is controlled by the <a href="../using-npm/config#cache.html"><code>cache</code> config</a> param.</p>
|
||||
<h4 id="temp-files">Temp Files</h4>
|
||||
<p>Temporary files are stored by default in the folder specified by the
|
||||
<a href="../using-npm/config#tmp.html"><code>tmp</code> config</a>, which defaults to the TMPDIR, TMP, or
|
||||
TEMP environment variables, or <code>/tmp</code> on Unix and <code>c:\windows\temp</code> on Windows.</p>
|
||||
<p>Temp files are given a unique folder under this root for each run of the
|
||||
program, and are deleted upon successful exit.</p>
|
||||
<h3 id="more-information">More Information</h3>
|
||||
<p>When installing locally, npm first tries to find an appropriate
|
||||
<code>prefix</code> folder. This is so that <code>npm install foo@1.2.3</code> will install
|
||||
to the sensible root of your package, even if you happen to have <code>cd</code>ed
|
||||
into some other folder.</p>
|
||||
<p>Starting at the $PWD, npm will walk up the folder tree checking for a
|
||||
folder that contains either a <code>package.json</code> file, or a <code>node_modules</code>
|
||||
folder. If such a thing is found, then that is treated as the effective
|
||||
"current directory" for the purpose of running npm commands. (This
|
||||
behavior is inspired by and similar to git's .git-folder seeking
|
||||
logic when running git commands in a working dir.)</p>
|
||||
<p>If no package root is found, then the current folder is used.</p>
|
||||
<p>When you run <code>npm install foo@1.2.3</code>, then the package is loaded into
|
||||
the cache, and then unpacked into <code>./node_modules/foo</code>. Then, any of
|
||||
foo's dependencies are similarly unpacked into
|
||||
<code>./node_modules/foo/node_modules/...</code>.</p>
|
||||
<p>Any bin files are symlinked to <code>./node_modules/.bin/</code>, so that they may
|
||||
be found by npm scripts when necessary.</p>
|
||||
<h4 id="global-installation">Global Installation</h4>
|
||||
<p>If the <a href="../using-npm/config#global.html"><code>global</code> config</a> is set to true, then npm will
|
||||
install packages "globally".</p>
|
||||
<p>For global installation, packages are installed roughly the same way,
|
||||
but using the folders described above.</p>
|
||||
<h4 id="cycles-conflicts-and-folder-parsimony">Cycles, Conflicts, and Folder Parsimony</h4>
|
||||
<p>Cycles are handled using the property of node's module system that it
|
||||
walks up the directories looking for <code>node_modules</code> folders. So, at every
|
||||
stage, if a package is already installed in an ancestor <code>node_modules</code>
|
||||
folder, then it is not installed at the current location.</p>
|
||||
<p>Consider the case above, where <code>foo -> bar -> baz</code>. Imagine if, in
|
||||
addition to that, baz depended on bar, so you'd have:
|
||||
<code>foo -> bar -> baz -> bar -> baz ...</code>. However, since the folder
|
||||
structure is: <code>foo/node_modules/bar/node_modules/baz</code>, there's no need to
|
||||
put another copy of bar into <code>.../baz/node_modules</code>, since when baz calls
|
||||
<code>require("bar")</code>, it will get the copy that is installed in
|
||||
<code>foo/node_modules/bar</code>.</p>
|
||||
<p>This shortcut is only used if the exact same
|
||||
version would be installed in multiple nested <code>node_modules</code> folders. It
|
||||
is still possible to have <code>a/node_modules/b/node_modules/a</code> if the two
|
||||
"a" packages are different versions. However, without repeating the
|
||||
exact same package multiple times, an infinite regress will always be
|
||||
prevented.</p>
|
||||
<p>Another optimization can be made by installing dependencies at the
|
||||
highest level possible, below the localized "target" folder (hoisting).
|
||||
Since version 3, npm hoists dependencies by default.</p>
|
||||
<h4 id="example">Example</h4>
|
||||
<p>Consider this dependency graph:</p>
|
||||
<pre><code class="language-bash">foo
|
||||
+-- blerg@1.2.5
|
||||
+-- bar@1.2.3
|
||||
| +-- blerg@1.x (latest=1.3.7)
|
||||
| +-- baz@2.x
|
||||
| | `-- quux@3.x
|
||||
| | `-- bar@1.2.3 (cycle)
|
||||
| `-- asdf@*
|
||||
`-- baz@1.2.3
|
||||
`-- quux@3.x
|
||||
`-- bar
|
||||
</code></pre>
|
||||
<p>In this case, we might expect a folder structure like this
|
||||
(with all dependencies hoisted to the highest level possible):</p>
|
||||
<pre><code class="language-bash">foo
|
||||
+-- node_modules
|
||||
+-- blerg (1.2.5) <---[A]
|
||||
+-- bar (1.2.3) <---[B]
|
||||
| +-- node_modules
|
||||
| +-- baz (2.0.2) <---[C]
|
||||
+-- asdf (2.3.4)
|
||||
+-- baz (1.2.3) <---[D]
|
||||
+-- quux (3.2.0) <---[E]
|
||||
</code></pre>
|
||||
<p>Since foo depends directly on <code>bar@1.2.3</code> and <code>baz@1.2.3</code>, those are
|
||||
installed in foo's <code>node_modules</code> 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's dependency on <code>blerg@1.x</code>,
|
||||
it does not install another copy under [B].</p>
|
||||
<p>Bar [B] also has dependencies on baz and asdf. Because it depends on <code>baz@2.x</code>, it cannot
|
||||
re-use the <code>baz@1.2.3</code> installed in the parent <code>node_modules</code> folder [D],
|
||||
and must install its own copy [C]. In order to minimize duplication, npm hoists
|
||||
dependencies to the top level by default, so asdf is installed under [A].</p>
|
||||
<p>Underneath bar, the <code>baz -> quux -> bar</code> dependency creates a cycle.
|
||||
However, because bar is already in quux's ancestry [B], it does not
|
||||
unpack another copy of bar into that folder. Likewise, quux's [E]
|
||||
folder tree is empty, because its dependency on bar is satisfied
|
||||
by the parent folder copy installed at [B].</p>
|
||||
<p>For a graphical breakdown of what is installed where, use <code>npm ls</code>.</p>
|
||||
<h4 id="publishing">Publishing</h4>
|
||||
<p>Upon publishing, npm will look in the <code>node_modules</code> folder. If any of
|
||||
the items there are not in the <code>bundleDependencies</code> array, then they will
|
||||
not be included in the package tarball.</p>
|
||||
<p>This allows a package maintainer to install all of their dependencies
|
||||
(and dev dependencies) locally, but only re-publish those items that
|
||||
cannot be found elsewhere. See <a href="../configuring-npm/package-json.html"><code>package.json</code></a> for more information.</p>
|
||||
<h3 id="see-also">See also</h3>
|
||||
<ul>
|
||||
<li><a href="../configuring-npm/package-json.html">package.json</a></li>
|
||||
<li><a href="../commands/npm-install.html">npm install</a></li>
|
||||
<li><a href="../commands/npm-pack.html">npm pack</a></li>
|
||||
<li><a href="../commands/npm-cache.html">npm cache</a></li>
|
||||
<li><a href="../commands/npm-config.html">npm config</a></li>
|
||||
<li><a href="../configuring-npm/npmrc.html">npmrc</a></li>
|
||||
<li><a href="../using-npm/config.html">config</a></li>
|
||||
<li><a href="../commands/npm-publish.html">npm publish</a></li>
|
||||
</ul></div>
|
||||
|
||||
<footer id="edit">
|
||||
<a href="https://github.com/npm/cli/edit/latest/docs/content/configuring-npm/folders.md">
|
||||
<svg role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentcolor" style="vertical-align: text-bottom; margin-right: 0.3em;">
|
||||
<path fill-rule="evenodd" d="M11.013 1.427a1.75 1.75 0 012.474 0l1.086 1.086a1.75 1.75 0 010 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 01-.927-.928l.929-3.25a1.75 1.75 0 01.445-.758l8.61-8.61zm1.414 1.06a.25.25 0 00-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 000-.354l-1.086-1.086zM11.189 6.25L9.75 4.81l-6.286 6.287a.25.25 0 00-.064.108l-.558 1.953 1.953-.558a.249.249 0 00.108-.064l6.286-6.286z"></path>
|
||||
</svg>
|
||||
Edit this page on GitHub
|
||||
</a>
|
||||
</footer>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
</body></html>
|
||||
+1080
File diff suppressed because it is too large.
Load diff
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npm-shrinkwrapjson">npm-shrinkwrap.json</h1>
|
||||
<h1 id="----npm-shrinkwrapjson----1080">
|
||||
<span>npm-shrinkwrap.json</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">A publishable lockfile</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="npmrc">npmrc</h1>
|
||||
<h1 id="----npmrc----1080">
|
||||
<span>npmrc</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">The npm config files</span>
|
||||
</header>
|
||||
|
||||
|
||||
+18
-13
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="packagejson">package.json</h1>
|
||||
<h1 id="----packagejson----1080">
|
||||
<span>package.json</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Specifics of npm's package.json handling</span>
|
||||
</header>
|
||||
|
||||
@@ -427,7 +435,7 @@ via <code>npm run-script</code>.</p>
|
||||
<p>For example, myapp could have this:</p>
|
||||
<pre><code class="language-json">{
|
||||
"bin": {
|
||||
"myapp": "./cli.js"
|
||||
"myapp": "bin/cli.js"
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
@@ -440,7 +448,7 @@ package, then you can just supply it as a string. For example:</p>
|
||||
<pre><code class="language-json">{
|
||||
"name": "my-program",
|
||||
"version": "1.2.5",
|
||||
"bin": "./path/to/program"
|
||||
"bin": "path/to/program"
|
||||
}
|
||||
</code></pre>
|
||||
<p>would be the same as this:</p>
|
||||
@@ -448,7 +456,7 @@ package, then you can just supply it as a string. For example:</p>
|
||||
"name": "my-program",
|
||||
"version": "1.2.5",
|
||||
"bin": {
|
||||
"my-program": "./path/to/program"
|
||||
"my-program": "path/to/program"
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
@@ -521,7 +529,7 @@ directory, use <code>directories.bin</code>.</p>
|
||||
walking the folder.</p>
|
||||
<h3 id="repository">repository</h3>
|
||||
<p>Specify the place where your code lives. This is helpful for people who
|
||||
want to contribute. If the git repo is on GitHub, then the <code>npm docs</code>
|
||||
want to contribute. If the git repo is on GitHub, then the <code>npm repo</code>
|
||||
command will be able to find you.</p>
|
||||
<p>Do it like this:</p>
|
||||
<pre><code class="language-json">{
|
||||
@@ -766,11 +774,12 @@ worked with every 1.x version of the host package, use <code>"^1.0"</code> or <c
|
||||
to express this. If you depend on features introduced in 1.5.2, use
|
||||
<code>"^1.5.2"</code>.</p>
|
||||
<h3 id="peerdependenciesmeta">peerDependenciesMeta</h3>
|
||||
<p>When a user installs your package, npm will emit warnings if packages
|
||||
specified in <code>peerDependencies</code> are not already installed. The
|
||||
<code>peerDependenciesMeta</code> field serves to provide npm more information on how
|
||||
<p>The <code>peerDependenciesMeta</code> field serves to provide npm more information on how
|
||||
your peer dependencies are to be used. Specifically, it allows peer
|
||||
dependencies to be marked as optional.</p>
|
||||
dependencies to be marked as optional. Npm will not automatically install
|
||||
optional peer dependencies. This allows you to
|
||||
integrate and interact with a variety of host packages without requiring
|
||||
all of them to be installed.</p>
|
||||
<p>For example:</p>
|
||||
<pre><code class="language-json">{
|
||||
"name": "tea-latte",
|
||||
@@ -786,10 +795,6 @@ dependencies to be marked as optional.</p>
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
<p>Marking a peer dependency as optional ensures npm will not emit a warning
|
||||
if the <code>soy-milk</code> package is not installed on the host. This allows you to
|
||||
integrate and interact with a variety of host packages without requiring
|
||||
all of them to be installed.</p>
|
||||
<h3 id="bundledependencies">bundleDependencies</h3>
|
||||
<p>This defines an array of package names that will be bundled when publishing
|
||||
the package.</p>
|
||||
|
||||
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="package-lockjson">package-lock.json</h1>
|
||||
<h1 id="----package-lockjson----1080">
|
||||
<span>package-lock.json</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">A manifestation of the manifest</span>
|
||||
</header>
|
||||
|
||||
|
||||
+10
-2
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="config">config</h1>
|
||||
<h1 id="----config----1080">
|
||||
<span>config</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">More than you probably want to know about npm configuration</span>
|
||||
</header>
|
||||
|
||||
@@ -1023,7 +1031,7 @@ a semver. Like the <code>rc</code> in <code>1.2.0-rc.8</code>.</p>
|
||||
<li>Type: Boolean</li>
|
||||
</ul>
|
||||
<p>When set to <code>true</code>, npm will display a progress bar during time intensive
|
||||
operations, if <code>process.stderr</code> is a TTY.</p>
|
||||
operations, if <code>process.stderr</code> and <code>process.stdout</code> are a TTY.</p>
|
||||
<p>Set to <code>false</code> to suppress the progress bar.</p>
|
||||
<h4 id="provenance"><code>provenance</code></h4>
|
||||
<ul>
|
||||
|
||||
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="dependency-selector-syntax--querying">Dependency Selector Syntax & Querying</h1>
|
||||
<h1 id="----dependency-selector-syntax--querying----1080">
|
||||
<span>Dependency Selector Syntax & Querying</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Dependency Selector Syntax & Querying</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="developers">developers</h1>
|
||||
<h1 id="----developers----1080">
|
||||
<span>developers</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Developer Guide</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="logging">Logging</h1>
|
||||
<h1 id="----logging----1080">
|
||||
<span>Logging</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Why, What & How We Log</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="orgs">orgs</h1>
|
||||
<h1 id="----orgs----1080">
|
||||
<span>orgs</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Working with Teams & Orgs</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="package-spec">package-spec</h1>
|
||||
<h1 id="----package-spec----1080">
|
||||
<span>package-spec</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Package name specifier</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="registry">registry</h1>
|
||||
<h1 id="----registry----1080">
|
||||
<span>registry</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">The JavaScript Package Registry</span>
|
||||
</header>
|
||||
|
||||
|
||||
+10
-4
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="removal">removal</h1>
|
||||
<h1 id="----removal----1080">
|
||||
<span>removal</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Cleaning the Slate</span>
|
||||
</header>
|
||||
|
||||
@@ -149,9 +157,7 @@ npm command-line interface
|
||||
<p>So sad to see you go.</p>
|
||||
<pre><code class="language-bash">sudo npm uninstall npm -g
|
||||
</code></pre>
|
||||
<p>Or, if that fails, get the npm source code, and do:</p>
|
||||
<pre><code class="language-bash">sudo make uninstall
|
||||
</code></pre>
|
||||
<p>Or, if that fails, please proceed to more severe uninstalling methods.</p>
|
||||
<h3 id="more-severe-uninstalling">More Severe Uninstalling</h3>
|
||||
<p>Usually, the above instructions are sufficient. That will remove
|
||||
npm, but leave behind anything you've installed.</p>
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="scope">scope</h1>
|
||||
<h1 id="----scope----1080">
|
||||
<span>scope</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Scoped packages</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="scripts">scripts</h1>
|
||||
<h1 id="----scripts----1080">
|
||||
<span>scripts</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">How npm handles the "scripts" field</span>
|
||||
</header>
|
||||
|
||||
|
||||
+9
-1
@@ -113,6 +113,11 @@ header.title > .description {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
header.title .version {
|
||||
font-size: 0.8em;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
footer#edit {
|
||||
border-top: solid 1px #e1e4e8;
|
||||
margin: 3em 0 4em 0;
|
||||
@@ -136,7 +141,10 @@ npm command-line interface
|
||||
|
||||
<section id="content">
|
||||
<header class="title">
|
||||
<h1 id="workspaces">workspaces</h1>
|
||||
<h1 id="----workspaces----1080">
|
||||
<span>workspaces</span>
|
||||
<span class="version">@10.8.0</span>
|
||||
</h1>
|
||||
<span class="description">Working with workspaces</span>
|
||||
</header>
|
||||
|
||||
|
||||
Vendored
+1
-28
@@ -1,4 +1,4 @@
|
||||
const { log, output } = require('proc-log')
|
||||
const { log } = require('proc-log')
|
||||
|
||||
class BaseCommand {
|
||||
static workspaces = false
|
||||
@@ -111,33 +111,6 @@ class BaseCommand {
|
||||
})
|
||||
}
|
||||
|
||||
async cmdExec (args) {
|
||||
const { config } = this.npm
|
||||
|
||||
if (config.get('usage')) {
|
||||
return output.standard(this.usage)
|
||||
}
|
||||
|
||||
const hasWsConfig = config.get('workspaces') || config.get('workspace').length
|
||||
// if cwd is a workspace, the default is set to [that workspace]
|
||||
const implicitWs = config.get('workspace', 'default').length
|
||||
|
||||
// (-ws || -w foo) && (cwd is not a workspace || command is not ignoring implicit workspaces)
|
||||
if (hasWsConfig && (!implicitWs || !this.constructor.ignoreImplicitWorkspace)) {
|
||||
if (this.npm.global) {
|
||||
throw new Error('Workspaces not supported for global packages')
|
||||
}
|
||||
if (!this.constructor.workspaces) {
|
||||
throw Object.assign(new Error('This command does not support workspaces.'), {
|
||||
code: 'ENOWORKSPACES',
|
||||
})
|
||||
}
|
||||
return this.execWorkspaces(args)
|
||||
}
|
||||
|
||||
return this.exec(args)
|
||||
}
|
||||
|
||||
// Compare the number of entries with what was expected
|
||||
checkExpected (entries) {
|
||||
if (!this.npm.config.isDefault('expect-results')) {
|
||||
|
||||
Vendored
+7
-15
@@ -15,7 +15,8 @@ module.exports = async (process, validateEngines) => {
|
||||
require('graceful-fs').gracefulify(require('fs'))
|
||||
|
||||
const satisfies = require('semver/functions/satisfies')
|
||||
const exitHandler = require('./exit-handler.js')
|
||||
const ExitHandler = require('./exit-handler.js')
|
||||
const exitHandler = new ExitHandler({ process })
|
||||
const Npm = require('../npm.js')
|
||||
const npm = new Npm()
|
||||
exitHandler.setNpm(npm)
|
||||
@@ -28,8 +29,7 @@ module.exports = async (process, validateEngines) => {
|
||||
|
||||
// At this point we've required a few files and can be pretty sure we dont contain invalid syntax for this version of node. It's possible a lazy require would, but that's unlikely enough that it's not worth catching anymore and we attach the more important exit handlers.
|
||||
validateEngines.off()
|
||||
process.on('uncaughtException', exitHandler)
|
||||
process.on('unhandledRejection', exitHandler)
|
||||
exitHandler.registerUncaughtHandlers()
|
||||
|
||||
// It is now safe to log a warning if they are using a version of node that is not going to fail on syntax errors but is still unsupported and untested and might not work reliably. This is safe to use the logger now which we want since this will show up in the error log too.
|
||||
if (!satisfies(validateEngines.node, validateEngines.engines)) {
|
||||
@@ -42,13 +42,13 @@ module.exports = async (process, validateEngines) => {
|
||||
const { exec, command, args } = await npm.load()
|
||||
|
||||
if (!exec) {
|
||||
return exitHandler()
|
||||
return exitHandler.exit()
|
||||
}
|
||||
|
||||
if (!command) {
|
||||
output.standard(npm.usage)
|
||||
process.exitCode = 1
|
||||
return exitHandler()
|
||||
return exitHandler.exit()
|
||||
}
|
||||
|
||||
// Options are prefixed by a hyphen-minus (-, \u2d).
|
||||
@@ -72,16 +72,8 @@ module.exports = async (process, validateEngines) => {
|
||||
updateNotifier(npm).then((msg) => (npm.updateNotification = msg))
|
||||
|
||||
await execPromise
|
||||
return exitHandler()
|
||||
return exitHandler.exit()
|
||||
} catch (err) {
|
||||
if (err.code === 'EUNKNOWNCOMMAND') {
|
||||
const didYouMean = require('../utils/did-you-mean.js')
|
||||
const suggestions = await didYouMean(npm.localPrefix, err.command)
|
||||
output.standard(`Unknown command: "${err.command}"${suggestions}\n`)
|
||||
output.standard('To see a list of supported npm commands, run:\n npm help')
|
||||
process.exitCode = 1
|
||||
return exitHandler()
|
||||
}
|
||||
return exitHandler(err)
|
||||
return exitHandler.exit(err)
|
||||
}
|
||||
}
|
||||
Vendored
+145
-132
@@ -1,160 +1,173 @@
|
||||
const { log, output, META } = require('proc-log')
|
||||
const errorMessage = require('../utils/error-message.js')
|
||||
const { redactLog: replaceInfo } = require('@npmcli/redact')
|
||||
const { errorMessage, getExitCodeFromError } = require('../utils/error-message.js')
|
||||
|
||||
let npm = null // set by the cli
|
||||
let exitHandlerCalled = false
|
||||
let showLogFileError = false
|
||||
class ExitHandler {
|
||||
#npm = null
|
||||
#process = null
|
||||
#exited = false
|
||||
#exitErrorMessage = false
|
||||
|
||||
process.on('exit', code => {
|
||||
const hasLoadedNpm = npm?.config.loaded
|
||||
#noNpmError = false
|
||||
|
||||
if (!code) {
|
||||
log.info('ok')
|
||||
} else {
|
||||
log.verbose('code', code)
|
||||
get #hasNpm () {
|
||||
return !!this.#npm
|
||||
}
|
||||
|
||||
if (!exitHandlerCalled) {
|
||||
process.exitCode = code || 1
|
||||
log.error('', 'Exit handler never called!')
|
||||
log.error('', 'This is an error with npm itself. Please report this error at:')
|
||||
log.error('', ' <https://github.com/npm/cli/issues>')
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('')
|
||||
showLogFileError = true
|
||||
get #loaded () {
|
||||
return !!this.#npm?.loaded
|
||||
}
|
||||
|
||||
// npm must be loaded to know where the log file was written
|
||||
if (hasLoadedNpm) {
|
||||
npm.finish({ showLogFileError })
|
||||
// This removes any listeners npm setup, mostly for tests to avoid max listener warnings
|
||||
npm.unload()
|
||||
get #showExitErrorMessage () {
|
||||
if (!this.#loaded) {
|
||||
return false
|
||||
}
|
||||
if (!this.#exited) {
|
||||
return true
|
||||
}
|
||||
return this.#exitErrorMessage
|
||||
}
|
||||
|
||||
// these are needed for the tests to have a clean slate in each test case
|
||||
exitHandlerCalled = false
|
||||
showLogFileError = false
|
||||
})
|
||||
|
||||
const exitHandler = err => {
|
||||
exitHandlerCalled = true
|
||||
|
||||
const hasLoadedNpm = npm?.config.loaded
|
||||
|
||||
if (!npm) {
|
||||
err = err || new Error('Exit prior to setting npm in exit handler')
|
||||
// Don't use proc-log here since npm was never set
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(err.stack || err.message)
|
||||
return process.exit(1)
|
||||
get #notLoadedOrExited () {
|
||||
return !this.#loaded && !this.#exited
|
||||
}
|
||||
|
||||
if (!hasLoadedNpm) {
|
||||
err = err || new Error('Exit prior to config file resolving.')
|
||||
// Don't use proc-log here since npm was never loaded
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(err.stack || err.message)
|
||||
setNpm (npm) {
|
||||
this.#npm = npm
|
||||
}
|
||||
|
||||
// only show the notification if it finished.
|
||||
if (typeof npm.updateNotification === 'string') {
|
||||
log.notice('', npm.updateNotification, { [META]: true, force: true })
|
||||
constructor ({ process }) {
|
||||
this.#process = process
|
||||
this.#process.on('exit', this.#handleProcesExitAndReset)
|
||||
}
|
||||
|
||||
let exitCode = process.exitCode || 0
|
||||
let noLogMessage = exitCode !== 0
|
||||
let jsonError
|
||||
registerUncaughtHandlers () {
|
||||
this.#process.on('uncaughtException', this.#handleExit)
|
||||
this.#process.on('unhandledRejection', this.#handleExit)
|
||||
}
|
||||
|
||||
if (err) {
|
||||
exitCode = 1
|
||||
// if we got a command that just shells out to something else, then it
|
||||
// will presumably print its own errors and exit with a proper status
|
||||
// code if there's a problem. If we got an error with a code=0, then...
|
||||
// something else went wrong along the way, so maybe an npm problem?
|
||||
const isShellout = npm.isShellout
|
||||
const quietShellout = isShellout && typeof err.code === 'number' && err.code
|
||||
if (quietShellout) {
|
||||
exitCode = err.code
|
||||
noLogMessage = true
|
||||
} else if (typeof err === 'string') {
|
||||
// XXX: we should stop throwing strings
|
||||
log.error('', err)
|
||||
noLogMessage = true
|
||||
} else if (!(err instanceof Error)) {
|
||||
log.error('weird error', err)
|
||||
noLogMessage = true
|
||||
exit (err) {
|
||||
this.#handleExit(err)
|
||||
}
|
||||
|
||||
#handleProcesExitAndReset = (code) => {
|
||||
this.#handleProcessExit(code)
|
||||
|
||||
// Reset all the state. This is only relevant for tests since
|
||||
// in reality the process fully exits here.
|
||||
this.#process.off('exit', this.#handleProcesExitAndReset)
|
||||
this.#process.off('uncaughtException', this.#handleExit)
|
||||
this.#process.off('unhandledRejection', this.#handleExit)
|
||||
if (this.#loaded) {
|
||||
this.#npm.unload()
|
||||
}
|
||||
this.#npm = null
|
||||
this.#exited = false
|
||||
this.#exitErrorMessage = false
|
||||
}
|
||||
|
||||
#handleProcessExit (code) {
|
||||
// Force exit code to a number if it has not been set
|
||||
const exitCode = typeof code === 'number' ? code : (this.#exited ? 0 : 1)
|
||||
this.#process.exitCode = exitCode
|
||||
|
||||
if (this.#notLoadedOrExited) {
|
||||
// Exit handler was not called and npm was not loaded so we have to log something
|
||||
this.#logConsoleError(new Error(`Process exited unexpectedly with code: ${exitCode}`))
|
||||
return
|
||||
}
|
||||
|
||||
if (this.#logNoNpmError()) {
|
||||
return
|
||||
}
|
||||
|
||||
const os = require('node:os')
|
||||
log.verbose('cwd', this.#process.cwd())
|
||||
log.verbose('os', `${os.type()} ${os.release()}`)
|
||||
log.verbose('node', this.#process.version)
|
||||
log.verbose('npm ', `v${this.#npm.version}`)
|
||||
|
||||
// only show the notification if it finished
|
||||
if (typeof this.#npm.updateNotification === 'string') {
|
||||
log.notice('', this.#npm.updateNotification, { [META]: true, force: true })
|
||||
}
|
||||
|
||||
if (!this.#exited) {
|
||||
log.error('', 'Exit handler never called!')
|
||||
log.error('', 'This is an error with npm itself. Please report this error at:')
|
||||
log.error('', ' <https://github.com/npm/cli/issues>')
|
||||
if (this.#npm.silent) {
|
||||
output.error('')
|
||||
}
|
||||
}
|
||||
|
||||
log.verbose('exit', exitCode)
|
||||
|
||||
if (exitCode) {
|
||||
log.verbose('code', exitCode)
|
||||
} else {
|
||||
const os = require('node:os')
|
||||
const fs = require('node:fs')
|
||||
if (!err.code) {
|
||||
const matchErrorCode = err.message.match(/^(?:Error: )?(E[A-Z]+)/)
|
||||
err.code = matchErrorCode && matchErrorCode[1]
|
||||
}
|
||||
log.info('ok')
|
||||
}
|
||||
|
||||
for (const k of ['type', 'stack', 'statusCode', 'pkgid']) {
|
||||
const v = err[k]
|
||||
if (v) {
|
||||
log.verbose(k, replaceInfo(v))
|
||||
}
|
||||
}
|
||||
|
||||
log.verbose('cwd', process.cwd())
|
||||
log.verbose('', os.type() + ' ' + os.release())
|
||||
log.verbose('node', process.version)
|
||||
log.verbose('npm ', 'v' + npm.version)
|
||||
|
||||
for (const k of ['code', 'syscall', 'file', 'path', 'dest', 'errno']) {
|
||||
const v = err[k]
|
||||
if (v) {
|
||||
log.error(k, v)
|
||||
}
|
||||
}
|
||||
|
||||
const { summary, detail, json, files = [] } = errorMessage(err, npm)
|
||||
jsonError = json
|
||||
|
||||
for (let [file, content] of files) {
|
||||
file = `${npm.logPath}${file}`
|
||||
content = `'Log files:\n${npm.logFiles.join('\n')}\n\n${content.trim()}\n`
|
||||
try {
|
||||
fs.writeFileSync(file, content)
|
||||
detail.push(['', `\n\nFor a full report see:\n${file}`])
|
||||
} catch (logFileErr) {
|
||||
log.warn('', `Could not write error message to ${file} due to ${logFileErr}`)
|
||||
}
|
||||
}
|
||||
|
||||
for (const errline of [...summary, ...detail]) {
|
||||
log.error(...errline)
|
||||
}
|
||||
|
||||
if (typeof err.errno === 'number') {
|
||||
exitCode = err.errno
|
||||
} else if (typeof err.code === 'number') {
|
||||
exitCode = err.code
|
||||
}
|
||||
if (this.#showExitErrorMessage) {
|
||||
log.error('', this.#npm.exitErrorMessage())
|
||||
}
|
||||
}
|
||||
|
||||
if (hasLoadedNpm) {
|
||||
output.flush({ [META]: true, jsonError })
|
||||
#logConsoleError (err) {
|
||||
// Run our error message formatters on all errors even if we
|
||||
// have no npm or an unloaded npm. This will clean the error
|
||||
// and possible return a formatted message about EACCESS or something.
|
||||
const { summary, detail } = errorMessage(err, this.#npm)
|
||||
const formatted = [...new Set([...summary, ...detail].flat().filter(Boolean))].join('\n')
|
||||
// If we didn't get anything from the formatted message then just display the full stack
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(formatted === err.message ? err.stack : formatted)
|
||||
}
|
||||
|
||||
log.verbose('exit', exitCode || 0)
|
||||
#logNoNpmError (err) {
|
||||
if (this.#hasNpm) {
|
||||
return false
|
||||
}
|
||||
// Make sure we only log this error once
|
||||
if (!this.#noNpmError) {
|
||||
this.#noNpmError = true
|
||||
this.#logConsoleError(
|
||||
new Error(`Exit prior to setting npm in exit handler`, err ? { cause: err } : {})
|
||||
)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
showLogFileError = (hasLoadedNpm && npm.silent) || noLogMessage
|
||||
? false
|
||||
: !!exitCode
|
||||
#handleExit = (err) => {
|
||||
this.#exited = true
|
||||
|
||||
// explicitly call process.exit now so we don't hang on things like the
|
||||
// update notifier, also flush stdout/err beforehand because process.exit doesn't
|
||||
// wait for that to happen.
|
||||
let flushed = 0
|
||||
const flush = [process.stderr, process.stdout]
|
||||
const exit = () => ++flushed === flush.length && process.exit(exitCode)
|
||||
flush.forEach((f) => f.write('', exit))
|
||||
// No npm at all
|
||||
if (this.#logNoNpmError(err)) {
|
||||
return this.#process.exit(this.#process.exitCode || getExitCodeFromError(err) || 1)
|
||||
}
|
||||
|
||||
// npm was never loaded but we still might have a config loading error or
|
||||
// something similar that we can run through the error message formatter
|
||||
// to give the user a clue as to what happened.s
|
||||
if (!this.#loaded) {
|
||||
this.#logConsoleError(new Error('Exit prior to config file resolving', { cause: err }))
|
||||
return this.#process.exit(this.#process.exitCode || getExitCodeFromError(err) || 1)
|
||||
}
|
||||
|
||||
this.#exitErrorMessage = err?.suppressError === true ? false : !!err
|
||||
|
||||
// Prefer the exit code of the error, then the current process exit code,
|
||||
// then set it to 1 if we still have an error. Otherwise we call process.exit
|
||||
// with undefined so that it can determine the final exit code
|
||||
const exitCode = err?.exitCode ?? this.#process.exitCode ?? (err ? 1 : undefined)
|
||||
|
||||
// explicitly call process.exit now so we don't hang on things like the
|
||||
// update notifier, also flush stdout/err beforehand because process.exit doesn't
|
||||
// wait for that to happen.
|
||||
this.#process.stderr.write('', () => this.#process.stdout.write('', () => {
|
||||
this.#process.exit(exitCode)
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = exitHandler
|
||||
module.exports.setNpm = n => (npm = n)
|
||||
module.exports = ExitHandler
|
||||
Vendored
+1
-1
@@ -3,7 +3,7 @@ const npa = require('npm-package-arg')
|
||||
const { output } = require('proc-log')
|
||||
const pkgJson = require('@npmcli/package-json')
|
||||
const localeCompare = require('@isaacs/string-locale-compare')('en')
|
||||
const otplease = require('../utils/otplease.js')
|
||||
const { otplease } = require('../utils/auth.js')
|
||||
const getIdentity = require('../utils/get-identity.js')
|
||||
const BaseCommand = require('../base-cmd.js')
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -90,7 +90,7 @@ class Audit extends ArboristWorkspaceCmd {
|
||||
)
|
||||
}
|
||||
|
||||
log.verbose('loading installed dependencies')
|
||||
log.verbose('audit', 'loading installed dependencies')
|
||||
const Arborist = require('@npmcli/arborist')
|
||||
const opts = {
|
||||
...this.npm.flatOptions,
|
||||
|
||||
Vendored
+1
-1
@@ -132,7 +132,7 @@ class Cache extends BaseCommand {
|
||||
try {
|
||||
entry = await cacache.get(cachePath, key)
|
||||
} catch (err) {
|
||||
log.warn(`Not Found: ${key}`)
|
||||
log.warn('cache', `Not Found: ${key}`)
|
||||
break
|
||||
}
|
||||
output.standard(`Deleted: ${key}`)
|
||||
|
||||
Vendored
+60
-23
@@ -7,17 +7,36 @@ const pkgJson = require('@npmcli/package-json')
|
||||
const { defaults, definitions } = require('@npmcli/config/lib/definitions')
|
||||
const { log, output } = require('proc-log')
|
||||
const BaseCommand = require('../base-cmd.js')
|
||||
const { redact } = require('@npmcli/redact')
|
||||
|
||||
// These are the configs that we can nerf-dart. Not all of them currently even
|
||||
// *have* config definitions so we have to explicitly validate them here
|
||||
// *have* config definitions so we have to explicitly validate them here.
|
||||
// This is used to validate during "npm config set"
|
||||
const nerfDarts = [
|
||||
'_auth',
|
||||
'_authToken',
|
||||
'username',
|
||||
'_password',
|
||||
'email',
|
||||
'certfile',
|
||||
'email',
|
||||
'keyfile',
|
||||
'username',
|
||||
]
|
||||
// These are the config values to swap with "protected". It does not catch
|
||||
// every single sensitive thing a user may put in the npmrc file but it gets
|
||||
// the common ones. This is distinct from nerfDarts because that is used to
|
||||
// validate valid configs during "npm config set", and folks may have old
|
||||
// invalid entries lying around in a config file that we still want to protect
|
||||
// when running "npm config list"
|
||||
// This is a more general list of values to consider protected. You can not
|
||||
// "npm config get" them, and they will not display during "npm config list"
|
||||
const protected = [
|
||||
'auth',
|
||||
'authToken',
|
||||
'certfile',
|
||||
'email',
|
||||
'keyfile',
|
||||
'password',
|
||||
'username',
|
||||
]
|
||||
|
||||
// take an array of `[key, value, k2=v2, k3, v3, ...]` and turn into
|
||||
@@ -35,18 +54,35 @@ const keyValues = args => {
|
||||
return kv
|
||||
}
|
||||
|
||||
const publicVar = k => {
|
||||
const isProtected = (k) => {
|
||||
// _password
|
||||
if (k.startsWith('_')) {
|
||||
return false
|
||||
return true
|
||||
}
|
||||
if (protected.includes(k)) {
|
||||
return true
|
||||
}
|
||||
// //localhost:8080/:_password
|
||||
if (k.startsWith('//') && k.includes(':_')) {
|
||||
return false
|
||||
if (k.startsWith('//')) {
|
||||
if (k.includes(':_')) {
|
||||
return true
|
||||
}
|
||||
// //registry:_authToken or //registry:authToken
|
||||
for (const p of protected) {
|
||||
if (k.endsWith(`:${p}`) || k.endsWith(`:_${p}`)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
return false
|
||||
}
|
||||
|
||||
// Private fields are either protected or they can redacted info
|
||||
const isPrivate = (k, v) => isProtected(k) || redact(v) !== v
|
||||
|
||||
const displayVar = (k, v) =>
|
||||
`${k} = ${isProtected(k, v) ? '(protected)' : JSON.stringify(redact(v))}`
|
||||
|
||||
class Config extends BaseCommand {
|
||||
static description = 'Manage the npm configuration files'
|
||||
static name = 'config'
|
||||
@@ -177,12 +213,13 @@ class Config extends BaseCommand {
|
||||
|
||||
const out = []
|
||||
for (const key of keys) {
|
||||
if (!publicVar(key)) {
|
||||
const val = this.npm.config.get(key)
|
||||
if (isPrivate(key, val)) {
|
||||
throw new Error(`The ${key} option is protected, and can not be retrieved in this way`)
|
||||
}
|
||||
|
||||
const pref = keys.length > 1 ? `${key}=` : ''
|
||||
out.push(pref + this.npm.config.get(key))
|
||||
out.push(pref + val)
|
||||
}
|
||||
output.standard(out.join('\n'))
|
||||
}
|
||||
@@ -309,18 +346,17 @@ ${defData}
|
||||
continue
|
||||
}
|
||||
|
||||
const keys = Object.keys(data).sort(localeCompare)
|
||||
if (!keys.length) {
|
||||
const entries = Object.entries(data).sort(([a], [b]) => localeCompare(a, b))
|
||||
if (!entries.length) {
|
||||
continue
|
||||
}
|
||||
|
||||
msg.push(`; "${where}" config from ${source}`, '')
|
||||
for (const k of keys) {
|
||||
const v = publicVar(k) ? JSON.stringify(data[k]) : '(protected)'
|
||||
for (const [k, v] of entries) {
|
||||
const display = displayVar(k, v)
|
||||
const src = this.npm.config.find(k)
|
||||
const overridden = src !== where
|
||||
msg.push((overridden ? '; ' : '') +
|
||||
`${k} = ${v} ${overridden ? `; overridden by ${src}` : ''}`)
|
||||
msg.push(src === where ? display : `; ${display} ; overridden by ${src}`)
|
||||
msg.push()
|
||||
}
|
||||
msg.push('')
|
||||
}
|
||||
@@ -345,10 +381,10 @@ ${defData}
|
||||
const pkgPath = resolve(this.npm.prefix, 'package.json')
|
||||
msg.push(`; "publishConfig" from ${pkgPath}`)
|
||||
msg.push('; This set of config values will be used at publish-time.', '')
|
||||
const pkgKeys = Object.keys(content.publishConfig).sort(localeCompare)
|
||||
for (const k of pkgKeys) {
|
||||
const v = publicVar(k) ? JSON.stringify(content.publishConfig[k]) : '(protected)'
|
||||
msg.push(`${k} = ${v}`)
|
||||
const entries = Object.entries(content.publishConfig)
|
||||
.sort(([a], [b]) => localeCompare(a, b))
|
||||
for (const [k, value] of entries) {
|
||||
msg.push(displayVar(k, value))
|
||||
}
|
||||
msg.push('')
|
||||
}
|
||||
@@ -360,11 +396,12 @@ ${defData}
|
||||
async listJson () {
|
||||
const publicConf = {}
|
||||
for (const key in this.npm.config.list[0]) {
|
||||
if (!publicVar(key)) {
|
||||
const value = this.npm.config.get(key)
|
||||
if (isPrivate(key, value)) {
|
||||
continue
|
||||
}
|
||||
|
||||
publicConf[key] = this.npm.config.get(key)
|
||||
publicConf[key] = value
|
||||
}
|
||||
output.standard(JSON.stringify(publicConf, null, 2))
|
||||
}
|
||||
|
||||
Vendored
+4
-1
@@ -1,6 +1,7 @@
|
||||
const fetch = require('npm-registry-fetch')
|
||||
const otplease = require('../utils/otplease.js')
|
||||
const { otplease } = require('../utils/auth.js')
|
||||
const npa = require('npm-package-arg')
|
||||
const { log } = require('proc-log')
|
||||
const semver = require('semver')
|
||||
const getIdentity = require('../utils/get-identity.js')
|
||||
const libaccess = require('libnpmaccess')
|
||||
@@ -66,6 +67,8 @@ class Deprecate extends BaseCommand {
|
||||
body: packument,
|
||||
ignoreBody: true,
|
||||
}))
|
||||
} else {
|
||||
log.warn('deprecate', 'No version found for', p.rawSpec)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@ const npa = require('npm-package-arg')
|
||||
const regFetch = require('npm-registry-fetch')
|
||||
const semver = require('semver')
|
||||
const { log, output } = require('proc-log')
|
||||
const otplease = require('../utils/otplease.js')
|
||||
const { otplease } = require('../utils/auth.js')
|
||||
const pkgJson = require('@npmcli/package-json')
|
||||
const BaseCommand = require('../base-cmd.js')
|
||||
|
||||
|
||||
Loaded 100 of 361 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user