deps: upgrade npm to 8.8.0

PR-URL: https://github.com/nodejs/node/pull/42886
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
This commit is contained in:
npm-robot authored and Myles Borins committed 2022-05-02 12:36:45 -04:00
1 parent f8b2156e07
commit 3ceeb574c3
174 files changed
+7813 -2246

No files matched your search

+3
View File
@@ -12,6 +12,9 @@ case `uname` in
esac
NODE_EXE="$basedir/node.exe"
if ! [ -x "$NODE_EXE" ]; then
NODE_EXE="$basedir/node"
fi
if ! [ -x "$NODE_EXE" ]; then
NODE_EXE=node
fi
+12
View File
@@ -399,6 +399,18 @@ This value is not exported to the environment for child processes.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### `install-links`
* Default: false
* Type: Boolean
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
+3 -2
View File
@@ -48,8 +48,9 @@ In short, the main differences between using `npm install` and `npm ci` are:
NOTE: If you create your `package-lock.json` file by running `npm install`
with flags that can affect the shape of your dependency tree, such as
`--legacy-peer-deps`, you _must_ provide the same flags to `npm ci` or you
are likely to encounter errors. An easy way to do this is to run
`--legacy-peer-deps` or `--install-links`, you _must_ provide the same
flags to `npm ci` or you are likely to encounter errors. An easy way to do
this is to run, for example,
`npm config set legacy-peer-deps=true --location=project` and commit the
`.npmrc` file to your repo.
+12
View File
@@ -310,6 +310,18 @@ This value is not exported to the environment for child processes.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### `install-links`
* Default: false
* Type: Boolean
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
+12
View File
@@ -234,6 +234,18 @@ This value is not exported to the environment for child processes.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### `install-links`
* Default: false
* Type: Boolean
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
+12
View File
@@ -319,6 +319,18 @@ This value is not exported to the environment for child processes.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### `install-links`
* Default: false
* Type: Boolean
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
+14 -2
View File
@@ -91,12 +91,12 @@ into a tarball (b).
*npm will not install the package dependencies* in the directory `<folder>`,
but it will create a symlink to `<folder>`.
> NOTE: If you want to install the content of a directory like a package from the registry instead of creating a link, you would need to use [`npm pack`](/commands/npm-pack) while in the `<folder>` directory, and then install the resulting tarball instead of the `<folder>` using `npm install <tarball file>`
> NOTE: If you want to install the content of a directory like a package from the registry instead of creating a link, you would need to use the `--install-links` option.
Example:
```bash
npm install ../../other-package
npm install ../../other-package --install-links
npm install ./sub-package
```
@@ -709,6 +709,18 @@ This value is not exported to the environment for child processes.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### `install-links`
* Default: false
* Type: Boolean
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### Algorithm
+12
View File
@@ -387,6 +387,18 @@ This value is not exported to the environment for child processes.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### `install-links`
* Default: false
* Type: Boolean
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
+12
View File
@@ -285,6 +285,18 @@ This value is not exported to the environment for child processes.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### `install-links`
* Default: false
* Type: Boolean
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
+12
View File
@@ -191,6 +191,18 @@ This value is not exported to the environment for child processes.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### `install-links`
* Default: false
* Type: Boolean
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
+12
View File
@@ -162,6 +162,18 @@ This value is not exported to the environment for child processes.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### `install-links`
* Default: false
* Type: Boolean
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
+12
View File
@@ -145,6 +145,18 @@ This value is not exported to the environment for child processes.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### `install-links`
* Default: false
* Type: Boolean
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
+12
View File
@@ -437,6 +437,18 @@ This value is not exported to the environment for child processes.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### `install-links`
* Default: false
* Type: Boolean
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
+14
View File
@@ -138,6 +138,8 @@ npm ls --global --parseable --long --loglevel info
* Type: null or String
A basic-auth string to use when authenticating against the npm registry.
This will ONLY be used to authenticate against the npm registry. For other
registries you will need to scope it like "//other-registry.tld/:_auth"
Warning: This should generally not be set via a command-line option. It is
safer to use a registry-provided authentication bearer token stored in the
@@ -891,6 +893,18 @@ number, if not already set in package.json.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### `install-links`
* Default: false
* Type: Boolean
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### `json`
* Default: false
+17 -3
View File
@@ -79,9 +79,23 @@ If you wish, you may associate a scope with a registry; see below.
#### Publishing public scoped packages to the primary npm registry
To publish a public scoped package, you must specify `--access public` with
the initial publication. This will publish the package and set access
to `public` as if you had run `npm access public` after publishing.
Publishing to a scope, you have two options:
- Publishing to your user scope (example: `@username/module`)
- Publishing to an organization scope (example: `@org/module`)
If publishing a public module to an organization scope, you must
first either create an organization with the name of the scope
that you'd like to publish to or be added to an existing organization
with the appropriate permisssions. For example, if you'd like to
publish to `@org`, you would need to create the `org` organization
on npmjs.com prior to trying to publish.
Scoped packages are not public by default. You will need to specify
`--access public` with the initial `npm publish` command. This will publish
the package and set access to `public` as if you had run `npm access public`
after publishing. You do not need to do this when publishing new versions of
an existing scoped package.
#### Publishing private scoped packages to the npm registry
+11 -1
View File
@@ -142,7 +142,7 @@ npm command-line interface
<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#audit-endpoints">Audit Endpoints</a></li><ul><li><a href="#bulk-advisory-endpoint">Bulk Advisory Endpoint</a></li><li><a href="#quick-audit-endpoint">Quick Audit Endpoint</a></li><li><a href="#scrubbing">Scrubbing</a></li><li><a href="#calculating-meta-vulnerabilities-and-remediations">Calculating Meta-Vulnerabilities and Remediations</a></li></ul><li><a href="#exit-code">Exit Code</a></li><li><a href="#examples">Examples</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#audit-level"><code>audit-level</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#force"><code>force</code></a></li><li><a href="#json"><code>json</code></a></li><li><a href="#package-lock-only"><code>package-lock-only</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#audit-endpoints">Audit Endpoints</a></li><ul><li><a href="#bulk-advisory-endpoint">Bulk Advisory Endpoint</a></li><li><a href="#quick-audit-endpoint">Quick Audit Endpoint</a></li><li><a href="#scrubbing">Scrubbing</a></li><li><a href="#calculating-meta-vulnerabilities-and-remediations">Calculating Meta-Vulnerabilities and Remediations</a></li></ul><li><a href="#exit-code">Exit Code</a></li><li><a href="#examples">Examples</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#audit-level"><code>audit-level</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#force"><code>force</code></a></li><li><a href="#json"><code>json</code></a></li><li><a href="#package-lock-only"><code>package-lock-only</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li><li><a href="#install-links"><code>install-links</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
</section>
<div id="_content"><h3 id="synopsis">Synopsis</h3>
@@ -442,6 +442,16 @@ the specified workspaces, and not on the root project.</p>
<p>This value is not exported to the environment for child processes.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h4 id="install-links"><code>install-links</code></h4>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h3 id="see-also">See Also</h3>
<ul>
+3 -2
View File
@@ -181,8 +181,9 @@ installs are essentially frozen.</li>
</ul>
<p>NOTE: If you create your <code>package-lock.json</code> file by running <code>npm install</code>
with flags that can affect the shape of your dependency tree, such as
<code>--legacy-peer-deps</code>, you <em>must</em> provide the same flags to <code>npm ci</code> or you
are likely to encounter errors. An easy way to do this is to run
<code>--legacy-peer-deps</code> or <code>--install-links</code>, you <em>must</em> provide the same
flags to <code>npm ci</code> or you are likely to encounter errors. An easy way to do
this is to run, for example,
<code>npm config set legacy-peer-deps=true --location=project</code> and commit the
<code>.npmrc</code> file to your repo.</p>
<h3 id="example">Example</h3>
+11 -1
View File
@@ -142,7 +142,7 @@ npm command-line interface
<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li><li><a href="#install-links"><code>install-links</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
</section>
<div id="_content"><h3 id="synopsis">Synopsis</h3>
@@ -383,6 +383,16 @@ the specified workspaces, and not on the root project.</p>
<p>This value is not exported to the environment for child processes.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h4 id="install-links"><code>install-links</code></h4>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h3 id="see-also">See Also</h3>
<ul>
+11 -1
View File
@@ -142,7 +142,7 @@ npm command-line interface
<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li><li><a href="#install-links"><code>install-links</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
</section>
<div id="_content"><h3 id="synopsis">Synopsis</h3>
@@ -327,6 +327,16 @@ the specified workspaces, and not on the root project.</p>
<p>This value is not exported to the environment for child processes.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h4 id="install-links"><code>install-links</code></h4>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h3 id="see-also">See Also</h3>
<ul>
+11 -1
View File
@@ -142,7 +142,7 @@ npm command-line interface
<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#save"><code>save</code></a></li><li><a href="#save-exact"><code>save-exact</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#save"><code>save</code></a></li><li><a href="#save-exact"><code>save-exact</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li><li><a href="#install-links"><code>install-links</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
</section>
<div id="_content"><h3 id="synopsis">Synopsis</h3>
@@ -399,6 +399,16 @@ the specified workspaces, and not on the root project.</p>
<p>This value is not exported to the environment for child processes.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h4 id="install-links"><code>install-links</code></h4>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h3 id="see-also">See Also</h3>
<ul>
+13 -3
View File
@@ -142,7 +142,7 @@ npm command-line interface
<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#save"><code>save</code></a></li><li><a href="#save-exact"><code>save-exact</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li></ul><li><a href="#algorithm">Algorithm</a></li><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#save"><code>save</code></a></li><li><a href="#save-exact"><code>save-exact</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li><li><a href="#install-links"><code>install-links</code></a></li></ul><li><a href="#algorithm">Algorithm</a></li><li><a href="#see-also">See Also</a></li></ul></div>
</section>
<div id="_content"><h3 id="synopsis">Synopsis</h3>
@@ -221,10 +221,10 @@ types of dependencies. If <code>&lt;folder&gt;</code> sits outside the root of y
<em>npm will not install the package dependencies</em> in the directory <code>&lt;folder&gt;</code>,
but it will create a symlink to <code>&lt;folder&gt;</code>.</p>
<blockquote>
<p>NOTE: If you want to install the content of a directory like a package from the registry instead of creating a link, you would need to use <a href="../commands/npm-pack.html"><code>npm pack</code></a> while in the <code>&lt;folder&gt;</code> directory, and then install the resulting tarball instead of the <code>&lt;folder&gt;</code> using <code>npm install &lt;tarball file&gt;</code></p>
<p>NOTE: If you want to install the content of a directory like a package from the registry instead of creating a link, you would need to use the <code>--install-links</code> option.</p>
</blockquote>
<p>Example:</p>
<pre lang="bash"><code>npm install ../../other-package
<pre lang="bash"><code>npm install ../../other-package --install-links
npm install ./sub-package
</code></pre>
</li>
@@ -725,6 +725,16 @@ the specified workspaces, and not on the root project.</p>
<p>This value is not exported to the environment for child processes.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h4 id="install-links"><code>install-links</code></h4>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h3 id="algorithm">Algorithm</h3>
<p>Given a <code>package{dep}</code> structure: <code>A{B,C}, B{C}, C{D}</code>,
+11 -1
View File
@@ -142,7 +142,7 @@ npm command-line interface
<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#caveat">Caveat</a></li><li><a href="#workspace-usage">Workspace Usage</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#save"><code>save</code></a></li><li><a href="#save-exact"><code>save-exact</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#caveat">Caveat</a></li><li><a href="#workspace-usage">Workspace Usage</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#save"><code>save</code></a></li><li><a href="#save-exact"><code>save-exact</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li><li><a href="#install-links"><code>install-links</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
</section>
<div id="_content"><h3 id="synopsis">Synopsis</h3>
@@ -442,6 +442,16 @@ the specified workspaces, and not on the root project.</p>
<p>This value is not exported to the environment for child processes.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h4 id="install-links"><code>install-links</code></h4>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h3 id="see-also">See Also</h3>
<ul>
+12 -2
View File
@@ -142,7 +142,7 @@ npm command-line interface
<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#note-design-changes-pending">Note: Design Changes Pending</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#all"><code>all</code></a></li><li><a href="#json"><code>json</code></a></li><li><a href="#long"><code>long</code></a></li><li><a href="#parseable"><code>parseable</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#depth"><code>depth</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#link"><code>link</code></a></li><li><a href="#package-lock-only"><code>package-lock-only</code></a></li><li><a href="#unicode"><code>unicode</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#note-design-changes-pending">Note: Design Changes Pending</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#all"><code>all</code></a></li><li><a href="#json"><code>json</code></a></li><li><a href="#long"><code>long</code></a></li><li><a href="#parseable"><code>parseable</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#depth"><code>depth</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#link"><code>link</code></a></li><li><a href="#package-lock-only"><code>package-lock-only</code></a></li><li><a href="#unicode"><code>unicode</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li><li><a href="#install-links"><code>install-links</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
</section>
<div id="_content"><h3 id="synopsis">Synopsis</h3>
@@ -166,7 +166,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 lang="bash"><code>npm@8.7.0 /path/to/npm
<pre lang="bash"><code>npm@8.8.0 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre>
@@ -366,6 +366,16 @@ the specified workspaces, and not on the root project.</p>
<p>This value is not exported to the environment for child processes.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h4 id="install-links"><code>install-links</code></h4>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h3 id="see-also">See Also</h3>
<ul>
+11 -1
View File
@@ -142,7 +142,7 @@ npm command-line interface
<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#omit"><code>omit</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#json"><code>json</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#omit"><code>omit</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#json"><code>json</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li><li><a href="#install-links"><code>install-links</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
</section>
<div id="_content"><h3 id="synopsis">Synopsis</h3>
@@ -291,6 +291,16 @@ the specified workspaces, and not on the root project.</p>
<p>This value is not exported to the environment for child processes.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h4 id="install-links"><code>install-links</code></h4>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h3 id="see-also">See Also</h3>
<ul>
+11 -1
View File
@@ -142,7 +142,7 @@ npm command-line interface
<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#global"><code>global</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#global"><code>global</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li><li><a href="#install-links"><code>install-links</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
</section>
<div id="_content"><h3 id="synopsis">Synopsis</h3>
@@ -272,6 +272,16 @@ the specified workspaces, and not on the root project.</p>
<p>This value is not exported to the environment for child processes.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h4 id="install-links"><code>install-links</code></h4>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h3 id="see-also">See Also</h3>
<ul>
+11 -1
View File
@@ -142,7 +142,7 @@ npm command-line interface
<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#examples">Examples</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#save"><code>save</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#examples">Examples</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#save"><code>save</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li><li><a href="#install-links"><code>install-links</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
</section>
<div id="_content"><h3 id="synopsis">Synopsis</h3>
@@ -249,6 +249,16 @@ the specified workspaces, and not on the root project.</p>
<p>This value is not exported to the environment for child processes.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h4 id="install-links"><code>install-links</code></h4>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h3 id="see-also">See Also</h3>
<ul>
+11 -1
View File
@@ -142,7 +142,7 @@ npm command-line interface
<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#example">Example</a></li><ul><li><a href="#caret-dependencies">Caret Dependencies</a></li><li><a href="#tilde-dependencies">Tilde Dependencies</a></li><li><a href="#caret-dependencies-below-100">Caret Dependencies below 1.0.0</a></li><li><a href="#subdependencies">Subdependencies</a></li><li><a href="#updating-globally-installed-packages">Updating Globally-Installed Packages</a></li></ul><li><a href="#configuration">Configuration</a></li><ul><li><a href="#save"><code>save</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#example">Example</a></li><ul><li><a href="#caret-dependencies">Caret Dependencies</a></li><li><a href="#tilde-dependencies">Tilde Dependencies</a></li><li><a href="#caret-dependencies-below-100">Caret Dependencies below 1.0.0</a></li><li><a href="#subdependencies">Subdependencies</a></li><li><a href="#updating-globally-installed-packages">Updating Globally-Installed Packages</a></li></ul><li><a href="#configuration">Configuration</a></li><ul><li><a href="#save"><code>save</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li><li><a href="#install-links"><code>install-links</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
</section>
<div id="_content"><h3 id="synopsis">Synopsis</h3>
@@ -478,6 +478,16 @@ the specified workspaces, and not on the root project.</p>
<p>This value is not exported to the environment for child processes.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h4 id="install-links"><code>install-links</code></h4>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h3 id="see-also">See Also</h3>
<ul>
+1 -1
View File
@@ -149,7 +149,7 @@ npm command-line interface
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h3 id="version">Version</h3>
<p>8.7.0</p>
<p>8.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
+14 -2
View File
@@ -142,7 +142,7 @@ npm command-line interface
<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="#command-line-flags">Command Line Flags</a></li><li><a href="#environment-variables">Environment Variables</a></li><li><a href="#npmrc-files">npmrc Files</a></li><li><a href="#default-configs">Default Configs</a></li></ul><li><a href="#shorthands-and-other-cli-niceties">Shorthands and Other CLI Niceties</a></li><li><a href="#config-settings">Config Settings</a></li><ul><li><a href="#auth"><code>_auth</code></a></li><li><a href="#access"><code>access</code></a></li><li><a href="#all"><code>all</code></a></li><li><a href="#allow-same-version"><code>allow-same-version</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#audit-level"><code>audit-level</code></a></li><li><a href="#before"><code>before</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#browser"><code>browser</code></a></li><li><a href="#ca"><code>ca</code></a></li><li><a href="#cache"><code>cache</code></a></li><li><a href="#cafile"><code>cafile</code></a></li><li><a href="#call"><code>call</code></a></li><li><a href="#cert"><code>cert</code></a></li><li><a href="#ci-name"><code>ci-name</code></a></li><li><a href="#cidr"><code>cidr</code></a></li><li><a href="#color"><code>color</code></a></li><li><a href="#commit-hooks"><code>commit-hooks</code></a></li><li><a href="#depth"><code>depth</code></a></li><li><a href="#description2"><code>description</code></a></li><li><a href="#diff"><code>diff</code></a></li><li><a href="#diff-dst-prefix"><code>diff-dst-prefix</code></a></li><li><a href="#diff-ignore-all-space"><code>diff-ignore-all-space</code></a></li><li><a href="#diff-name-only"><code>diff-name-only</code></a></li><li><a href="#diff-no-prefix"><code>diff-no-prefix</code></a></li><li><a href="#diff-src-prefix"><code>diff-src-prefix</code></a></li><li><a href="#diff-text"><code>diff-text</code></a></li><li><a href="#diff-unified"><code>diff-unified</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#editor"><code>editor</code></a></li><li><a href="#engine-strict"><code>engine-strict</code></a></li><li><a href="#fetch-retries"><code>fetch-retries</code></a></li><li><a href="#fetch-retry-factor"><code>fetch-retry-factor</code></a></li><li><a href="#fetch-retry-maxtimeout"><code>fetch-retry-maxtimeout</code></a></li><li><a href="#fetch-retry-mintimeout"><code>fetch-retry-mintimeout</code></a></li><li><a href="#fetch-timeout"><code>fetch-timeout</code></a></li><li><a href="#force"><code>force</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#format-package-lock"><code>format-package-lock</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#git"><code>git</code></a></li><li><a href="#git-tag-version"><code>git-tag-version</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#globalconfig"><code>globalconfig</code></a></li><li><a href="#heading"><code>heading</code></a></li><li><a href="#https-proxy"><code>https-proxy</code></a></li><li><a href="#if-present"><code>if-present</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#include"><code>include</code></a></li><li><a href="#include-staged"><code>include-staged</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li><li><a href="#init-author-email"><code>init-author-email</code></a></li><li><a href="#init-author-name"><code>init-author-name</code></a></li><li><a href="#init-author-url"><code>init-author-url</code></a></li><li><a href="#init-license"><code>init-license</code></a></li><li><a href="#init-module"><code>init-module</code></a></li><li><a href="#init-version"><code>init-version</code></a></li><li><a href="#json"><code>json</code></a></li><li><a href="#key"><code>key</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#legacy-peer-deps"><code>legacy-peer-deps</code></a></li><li><a href="#link"><code>link</code></a></li><li><a href="#local-address"><code>local-address</code></a></li><li><a href="#location"><code>location</code></a></li><li><a href="#lockfile-version"><code>lockfile-version</code></a></li><li><a href="#loglevel"><code>loglevel</code></a></li><li><a href="#logs-dir"><code>logs-dir</code></a></li><li><a href="#logs-max"><code>logs-max</code></a></li><li><a href="#long"><code>long</code></a></li><li><a href="#maxsockets"><code>maxsockets</code></a></li><li><a href="#message"><code>message</code></a></li><li><a href="#node-options"><code>node-options</code></a></li><li><a href="#node-version"><code>node-version</code></a></li><li><a href="#noproxy"><code>noproxy</code></a></li><li><a href="#npm-version"><code>npm-version</code></a></li><li><a href="#offline"><code>offline</code></a></li><li><a href="#omit"><code>omLine truncated
<div id="_table_of_contents"><ul><li><a href="#description">Description</a></li><ul><li><a href="#command-line-flags">Command Line Flags</a></li><li><a href="#environment-variables">Environment Variables</a></li><li><a href="#npmrc-files">npmrc Files</a></li><li><a href="#default-configs">Default Configs</a></li></ul><li><a href="#shorthands-and-other-cli-niceties">Shorthands and Other CLI Niceties</a></li><li><a href="#config-settings">Config Settings</a></li><ul><li><a href="#auth"><code>_auth</code></a></li><li><a href="#access"><code>access</code></a></li><li><a href="#all"><code>all</code></a></li><li><a href="#allow-same-version"><code>allow-same-version</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#audit-level"><code>audit-level</code></a></li><li><a href="#before"><code>before</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#browser"><code>browser</code></a></li><li><a href="#ca"><code>ca</code></a></li><li><a href="#cache"><code>cache</code></a></li><li><a href="#cafile"><code>cafile</code></a></li><li><a href="#call"><code>call</code></a></li><li><a href="#cert"><code>cert</code></a></li><li><a href="#ci-name"><code>ci-name</code></a></li><li><a href="#cidr"><code>cidr</code></a></li><li><a href="#color"><code>color</code></a></li><li><a href="#commit-hooks"><code>commit-hooks</code></a></li><li><a href="#depth"><code>depth</code></a></li><li><a href="#description2"><code>description</code></a></li><li><a href="#diff"><code>diff</code></a></li><li><a href="#diff-dst-prefix"><code>diff-dst-prefix</code></a></li><li><a href="#diff-ignore-all-space"><code>diff-ignore-all-space</code></a></li><li><a href="#diff-name-only"><code>diff-name-only</code></a></li><li><a href="#diff-no-prefix"><code>diff-no-prefix</code></a></li><li><a href="#diff-src-prefix"><code>diff-src-prefix</code></a></li><li><a href="#diff-text"><code>diff-text</code></a></li><li><a href="#diff-unified"><code>diff-unified</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#editor"><code>editor</code></a></li><li><a href="#engine-strict"><code>engine-strict</code></a></li><li><a href="#fetch-retries"><code>fetch-retries</code></a></li><li><a href="#fetch-retry-factor"><code>fetch-retry-factor</code></a></li><li><a href="#fetch-retry-maxtimeout"><code>fetch-retry-maxtimeout</code></a></li><li><a href="#fetch-retry-mintimeout"><code>fetch-retry-mintimeout</code></a></li><li><a href="#fetch-timeout"><code>fetch-timeout</code></a></li><li><a href="#force"><code>force</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#format-package-lock"><code>format-package-lock</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#git"><code>git</code></a></li><li><a href="#git-tag-version"><code>git-tag-version</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#globalconfig"><code>globalconfig</code></a></li><li><a href="#heading"><code>heading</code></a></li><li><a href="#https-proxy"><code>https-proxy</code></a></li><li><a href="#if-present"><code>if-present</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#include"><code>include</code></a></li><li><a href="#include-staged"><code>include-staged</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li><li><a href="#init-author-email"><code>init-author-email</code></a></li><li><a href="#init-author-name"><code>init-author-name</code></a></li><li><a href="#init-author-url"><code>init-author-url</code></a></li><li><a href="#init-license"><code>init-license</code></a></li><li><a href="#init-module"><code>init-module</code></a></li><li><a href="#init-version"><code>init-version</code></a></li><li><a href="#install-links"><code>install-links</code></a></li><li><a href="#json"><code>json</code></a></li><li><a href="#key"><code>key</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#legacy-peer-deps"><code>legacy-peer-deps</code></a></li><li><a href="#link"><code>link</code></a></li><li><a href="#local-address"><code>local-address</code></a></li><li><a href="#location"><code>location</code></a></li><li><a href="#lockfile-version"><code>lockfile-version</code></a></li><li><a href="#loglevel"><code>loglevel</code></a></li><li><a href="#logs-dir"><code>logs-dir</code></a></li><li><a href="#logs-max"><code>logs-max</code></a></li><li><a href="#long"><code>long</code></a></li><li><a href="#maxsockets"><code>maxsockets</code></a></li><li><a href="#message"><code>message</code></a></li><li><a href="#node-options"><code>node-options</code></a></li><li><a href="#node-version"><code>node-version</code></a></li><li><a href="#noproxy"><code>noproxy</code></a></li><li><a href="#npm-version"><code>npm-version</code></a></li><li><a href="#ofLine truncated
</section>
<div id="_content"><h3 id="description">Description</h3>
@@ -257,7 +257,9 @@ npm ls --global --parseable --long --loglevel info
<li>Default: null</li>
<li>Type: null or String</li>
</ul>
<p>A basic-auth string to use when authenticating against the npm registry.</p>
<p>A basic-auth string to use when authenticating against the npm registry.
This will ONLY be used to authenticate against the npm registry. For other
registries you will need to scope it like "//other-registry.tld/:_auth"</p>
<p>Warning: This should generally not be set via a command-line option. It is
safer to use a registry-provided authentication bearer token stored in the
~/.npmrc file by running <code>npm login</code>.</p>
@@ -862,6 +864,16 @@ more information, or <a href="../commands/npm-init.html">npm init</a>.</p>
number, if not already set in package.json.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h4 id="install-links"><code>install-links</code></h4>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h4 id="json"><code>json</code></h4>
<ul>
<li>Default: false</li>
+16 -3
View File
@@ -194,9 +194,22 @@ registry.</p>
<strong>does</strong> support scoped packages.)</p>
<p>If you wish, you may associate a scope with a registry; see below.</p>
<h4 id="publishing-public-scoped-packages-to-the-primary-npm-registry">Publishing public scoped packages to the primary npm registry</h4>
<p>To publish a public scoped package, you must specify <code>--access public</code> with
the initial publication. This will publish the package and set access
to <code>public</code> as if you had run <code>npm access public</code> after publishing.</p>
<p>Publishing to a scope, you have two options:</p>
<ul>
<li>Publishing to your user scope (example: <code>@username/module</code>)</li>
<li>Publishing to an organization scope (example: <code>@org/module</code>)</li>
</ul>
<p>If publishing a public module to an organization scope, you must
first either create an organization with the name of the scope
that you'd like to publish to or be added to an existing organization
with the appropriate permisssions. For example, if you'd like to
publish to <code>@org</code>, you would need to create the <code>org</code> organization
on npmjs.com prior to trying to publish.</p>
<p>Scoped packages are not public by default. You will need to specify
<code>--access public</code> with the initial <code>npm publish</code> command. This will publish
the package and set access to <code>public</code> as if you had run <code>npm access public</code>
after publishing. You do not need to do this when publishing new versions of
an existing scoped package.</p>
<h4 id="publishing-private-scoped-packages-to-the-npm-registry">Publishing private scoped packages to the npm registry</h4>
<p>To publish a private scoped package to the npm registry, you must have
an <a href="https://docs.npmjs.com/private-modules/intro">npm Private Modules</a>
+1
View File
@@ -12,6 +12,7 @@ class ArboristCmd extends BaseCommand {
'workspace',
'workspaces',
'include-workspace-root',
'install-links',
]
static ignoreImplicitWorkspace = false
+1 -1
View File
@@ -26,7 +26,7 @@ class Deprecate extends BaseCommand {
const packages = await libaccess.lsPackages(username, this.npm.flatOptions)
return Object.keys(packages)
.filter((name) =>
packages[name] === 'write' &&
packages[name] === 'read-write' &&
(opts.conf.argv.remain.length === 0 ||
name.startsWith(opts.conf.argv.remain[0])))
}
+7 -4
View File
@@ -6,7 +6,7 @@ const Arborist = require('@npmcli/arborist')
const pacote = require('pacote')
const pickManifest = require('npm-pick-manifest')
const log = require('../utils/log-shim')
const readPackageName = require('../utils/read-package-name.js')
const readPackage = require('read-package-json-fast')
const BaseCommand = require('../base-command.js')
class Diff extends BaseCommand {
@@ -81,7 +81,8 @@ class Diff extends BaseCommand {
async packageName (path) {
let name
try {
name = await readPackageName(this.prefix)
const pkg = await readPackage(resolve(this.prefix, 'package.json'))
name = pkg.name
} catch (e) {
log.verbose('diff', 'could not read project dir package.json')
}
@@ -114,7 +115,8 @@ class Diff extends BaseCommand {
let noPackageJson
let pkgName
try {
pkgName = await readPackageName(this.prefix)
const pkg = await readPackage(resolve(this.prefix, 'package.json'))
pkgName = pkg.name
} catch (e) {
log.verbose('diff', 'could not read project dir package.json')
noPackageJson = true
@@ -225,7 +227,8 @@ class Diff extends BaseCommand {
if (semverA && semverB) {
let pkgName
try {
pkgName = await readPackageName(this.prefix)
const pkg = await readPackage(resolve(this.prefix, 'package.json'))
pkgName = pkg.name
} catch (e) {
log.verbose('diff', 'could not read project dir package.json')
}
+5 -4
View File
@@ -1,9 +1,10 @@
const npa = require('npm-package-arg')
const path = require('path')
const regFetch = require('npm-registry-fetch')
const semver = require('semver')
const log = require('../utils/log-shim')
const otplease = require('../utils/otplease.js')
const readPackageName = require('../utils/read-package-name.js')
const readPackage = require('read-package-json-fast')
const BaseCommand = require('../base-command.js')
class DistTag extends BaseCommand {
@@ -150,12 +151,12 @@ class DistTag extends BaseCommand {
if (this.npm.config.get('global')) {
throw this.usageError()
}
const pkg = await readPackageName(this.npm.prefix)
if (!pkg) {
const { name } = await readPackage(path.resolve(this.npm.prefix, 'package.json'))
if (!name) {
throw this.usageError()
}
return this.list(pkg, opts)
return this.list(name, opts)
}
spec = npa(spec)
+3 -5
View File
@@ -48,10 +48,8 @@ class Exec extends BaseCommand {
static ignoreImplicitWorkspace = false
static isShellout = true
async exec (_args, { locationMsg, path, runPath } = {}) {
if (!path) {
path = this.npm.localPrefix
}
async exec (_args, { locationMsg, runPath } = {}) {
const path = this.npm.localPrefix
if (!runPath) {
runPath = process.cwd()
@@ -95,7 +93,7 @@ class Exec extends BaseCommand {
for (const path of this.workspacePaths) {
const locationMsg = await getLocationMsg({ color, path })
await this.exec(args, { locationMsg, path, runPath: path })
await this.exec(args, { locationMsg, runPath: path })
}
}
}
+3 -1
View File
@@ -6,6 +6,8 @@ const glob = promisify(require('glob'))
const readFile = promisify(fs.readFile)
const BaseCommand = require('../base-command.js')
const globify = pattern => pattern.split('\\').join('/')
class HelpSearch extends BaseCommand {
static description = 'Search npm help documentation'
static name = 'help-search'
@@ -19,7 +21,7 @@ class HelpSearch extends BaseCommand {
}
const docPath = path.resolve(__dirname, '..', '..', 'docs/content')
const files = await glob(`${docPath}/*/*.md`)
const files = await glob(`${globify(docPath)}/*/*.md`)
const data = await this.readFiles(files)
const results = await this.searchFiles(args, data, files)
const formatted = this.formatResults(args, results)
+3 -2
View File
@@ -5,6 +5,7 @@ const { promisify } = require('util')
const glob = promisify(require('glob'))
const localeCompare = require('@isaacs/string-locale-compare')('en')
const globify = pattern => pattern.split('\\').join('/')
const BaseCommand = require('../base-command.js')
// Strips out the number from foo.7 or foo.7. or foo.7.tgz
@@ -26,7 +27,7 @@ class Help extends BaseCommand {
return []
}
const g = path.resolve(__dirname, '../../man/man[0-9]/*.[0-9]')
const files = await glob(g)
const files = await glob(globify(g))
return Object.keys(files.reduce(function (acc, file) {
file = path.basename(file).replace(/\.[0-9]+$/, '')
@@ -61,7 +62,7 @@ class Help extends BaseCommand {
const manroot = path.resolve(__dirname, '..', '..', 'man')
// find either section.n or npm-section.n
const f = `${manroot}/${manSearch}/?(npm-)${section}.[0-9]*`
let mans = await glob(f)
let mans = await glob(globify(f))
mans = mans.sort((a, b) => {
// Prefer the page with an npm prefix, if there's only one.
const aHasPrefix = manNpmPrefixRegex.test(a)
+6
View File
@@ -139,6 +139,12 @@ class Install extends ArboristWorkspaceCmd {
args = ['.']
}
// throw usage error if trying to install empty package
// name to global space, e.g: `npm i -g ""`
if (where === globalTop && !args.every(Boolean)) {
throw this.usageError()
}
const opts = {
...this.npm.flatOptions,
auditLevel: null,
+32 -32
View File
@@ -3,8 +3,18 @@ const npmFetch = require('npm-registry-fetch')
const pacote = require('pacote')
const log = require('../utils/log-shim')
const otplease = require('../utils/otplease.js')
const readLocalPkgName = require('../utils/read-package-name.js')
const readPackageJsonFast = require('read-package-json-fast')
const BaseCommand = require('../base-command.js')
const { resolve } = require('path')
const readJson = async (pkg) => {
try {
const json = await readPackageJsonFast(pkg)
return json
} catch {
return {}
}
}
class Owner extends BaseCommand {
static description = 'Manage package owners'
@@ -41,12 +51,12 @@ class Owner extends BaseCommand {
if (this.npm.config.get('global')) {
return []
}
const pkgName = await readLocalPkgName(this.npm.prefix)
if (!pkgName) {
const { name } = await readJson(resolve(this.npm.prefix, 'package.json'))
if (!name) {
return []
}
const spec = npa(pkgName)
const spec = npa(name)
const data = await pacote.packument(spec, {
...this.npm.flatOptions,
fullMetadata: true,
@@ -96,12 +106,12 @@ class Owner extends BaseCommand {
if (this.npm.config.get('global')) {
throw this.usageError()
}
const pkgName = await readLocalPkgName(this.npm.prefix)
if (!pkgName) {
const { name } = await readJson(resolve(this.npm.prefix, 'package.json'))
if (!name) {
throw this.usageError()
}
return pkgName
return name
}
return pkg
}
@@ -125,15 +135,6 @@ class Owner extends BaseCommand {
throw err
}
if (!u || !u.name || u.error) {
throw Object.assign(
new Error(
"Couldn't get user data for " + user + ': ' + JSON.stringify(u)
),
{ code: 'EOWNERUSER' }
)
}
// normalize user data
u = { name: u.name, email: u.email }
@@ -177,32 +178,31 @@ class Owner extends BaseCommand {
}
const dataPath = `/${spec.escapedName}/-rev/${encodeURIComponent(data._rev)}`
const res = await otplease(this.npm.flatOptions, opts => {
return npmFetch.json(dataPath, {
...opts,
method: 'PUT',
body: {
_id: data._id,
_rev: data._rev,
maintainers,
},
spec,
try {
const res = await otplease(this.npm.flatOptions, opts => {
return npmFetch.json(dataPath, {
...opts,
method: 'PUT',
body: {
_id: data._id,
_rev: data._rev,
maintainers,
},
spec,
})
})
})
if (!res.error) {
if (addOrRm === 'add') {
this.npm.output(`+ ${user} (${spec.name})`)
} else {
this.npm.output(`- ${user} (${spec.name})`)
}
} else {
return res
} catch (err) {
throw Object.assign(
new Error('Failed to update package: ' + JSON.stringify(res)),
new Error('Failed to update package: ' + JSON.stringify(err.message)),
{ code: 'EOWNERMUTATE' }
)
}
return res
}
}
+15 -16
View File
@@ -69,10 +69,6 @@ class Publish extends BaseCommand {
const spec = npa(args[0])
let manifest = await this.getManifest(spec, opts)
if (manifest.publishConfig) {
flatten(manifest.publishConfig, opts)
}
// only run scripts for directory type publishes
if (spec.type === 'directory' && !ignoreScripts) {
await runScript({
@@ -92,12 +88,8 @@ class Publish extends BaseCommand {
// so that we send the latest and greatest thing to the registry
// note that publishConfig might have changed as well!
manifest = await this.getManifest(spec, opts)
if (manifest.publishConfig) {
flatten(manifest.publishConfig, opts)
}
// note that logTar calls log.notice(), so if we ARE in silent mode,
// this will do nothing, but we still want it in the debuglog if it fails.
// JSON already has the package contents
if (!json) {
logTar(pkgContents, { unicode })
}
@@ -197,15 +189,22 @@ class Publish extends BaseCommand {
// if it's a directory, read it from the file system
// otherwise, get the full metadata from whatever it is
getManifest (spec, opts) {
// XXX can't pacote read the manifest from a directory?
async getManifest (spec, opts) {
let manifest
if (spec.type === 'directory') {
return readJson(`${spec.fetchSpec}/package.json`)
manifest = await readJson(`${spec.fetchSpec}/package.json`)
} else {
manifest = await pacote.manifest(spec, {
...opts,
fullmetadata: true,
fullReadJson: true,
})
}
return pacote.manifest(spec, {
...opts,
fullMetadata: true,
fullReadJson: true,
})
if (manifest.publishConfig) {
flatten(manifest.publishConfig, opts)
}
return manifest
}
}
module.exports = Publish
+13
View File
@@ -147,6 +147,8 @@ define('_auth', {
type: [null, String],
description: `
A basic-auth string to use when authenticating against the npm registry.
This will ONLY be used to authenticate against the npm registry. For other
registries you will need to scope it like "//other-registry.tld/:_auth"
Warning: This should generally not be set via a command-line option. It
is safer to use a registry-provided authentication bearer token stored in
@@ -1070,6 +1072,17 @@ define('init.version', {
`,
})
define('install-links', {
default: false,
type: Boolean,
description: `
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink. This option has no effect on workspaces.
`,
flatten,
})
define('json', {
default: false,
type: Boolean,
+3 -2
View File
@@ -9,6 +9,7 @@ const fs = require('@npmcli/fs')
const log = require('./log-shim')
const padZero = (n, length) => n.toString().padStart(length.toString().length, '0')
const globify = pattern => pattern.split('\\').join('/')
const _logHandler = Symbol('logHandler')
const _formatLogItem = Symbol('formatLogItem')
@@ -225,7 +226,7 @@ class LogFiles {
)
// Always ignore the currently written files
const files = await glob(logGlob, { ignore: this.#files })
const files = await glob(globify(logGlob), { ignore: this.#files.map(globify) })
const toDelete = files.length - this.#logsMax
if (toDelete <= 0) {
@@ -236,7 +237,7 @@ class LogFiles {
for (const file of files.slice(0, toDelete)) {
try {
await rimraf(file)
await rimraf(file, { glob: false })
} catch (e) {
log.silly('logfile', 'error removing log file', file, e)
}
+12
View File
@@ -423,6 +423,18 @@ all workspaces via the \fBworkspaces\fP flag, will cause npm to operate only on
the specified workspaces, and not on the root project\.
.P
This value is not exported to the environment for child processes\.
.SS \fBinstall\-links\fP
.RS 0
.IP \(bu 2
Default: false
.IP \(bu 2
Type: Boolean
.RE
.P
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink\. This option has no effect on workspaces\.
.SS See Also
.RS 0
.IP \(bu 2
+3 -2
View File
@@ -48,8 +48,9 @@ installs are essentially frozen\.
.P
NOTE: If you create your \fBpackage\-lock\.json\fP file by running \fBnpm install\fP
with flags that can affect the shape of your dependency tree, such as
\fB\-\-legacy\-peer\-deps\fP, you \fImust\fR provide the same flags to \fBnpm ci\fP or you
are likely to encounter errors\. An easy way to do this is to run
\fB\-\-legacy\-peer\-deps\fP or \fB\-\-install\-links\fP, you \fImust\fR provide the same
flags to \fBnpm ci\fP or you are likely to encounter errors\. An easy way to do
this is to run, for example,
\fBnpm config set legacy\-peer\-deps=true \-\-location=project\fP and commit the
\fB\|\.npmrc\fP file to your repo\.
.SS Example
+12
View File
@@ -308,6 +308,18 @@ all workspaces via the \fBworkspaces\fP flag, will cause npm to operate only on
the specified workspaces, and not on the root project\.
.P
This value is not exported to the environment for child processes\.
.SS \fBinstall\-links\fP
.RS 0
.IP \(bu 2
Default: false
.IP \(bu 2
Type: Boolean
.RE
.P
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink\. This option has no effect on workspaces\.
.SS See Also
.RS 0
.IP \(bu 2
+12
View File
@@ -226,6 +226,18 @@ all workspaces via the \fBworkspaces\fP flag, will cause npm to operate only on
the specified workspaces, and not on the root project\.
.P
This value is not exported to the environment for child processes\.
.SS \fBinstall\-links\fP
.RS 0
.IP \(bu 2
Default: false
.IP \(bu 2
Type: Boolean
.RE
.P
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink\. This option has no effect on workspaces\.
.SS See Also
.RS 0
.IP \(bu 2
+12
View File
@@ -316,6 +316,18 @@ all workspaces via the \fBworkspaces\fP flag, will cause npm to operate only on
the specified workspaces, and not on the root project\.
.P
This value is not exported to the environment for child processes\.
.SS \fBinstall\-links\fP
.RS 0
.IP \(bu 2
Default: false
.IP \(bu 2
Type: Boolean
.RE
.P
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink\. This option has no effect on workspaces\.
.SS See Also
.RS 0
.IP \(bu 2
+14 -2
View File
@@ -91,14 +91,14 @@ NOTE: The \fB\-\-production\fP flag has no particular meaning when adding a
\fInpm will not install the package dependencies\fR in the directory \fB<folder>\fP,
but it will create a symlink to \fB<folder>\fP\|\.
.QP
NOTE: If you want to install the content of a directory like a package from the registry instead of creating a link, you would need to use npm help \fBpack\fP while in the \fB<folder>\fP directory, and then install the resulting tarball instead of the \fB<folder>\fP using \fBnpm install <tarball file>\fP
NOTE: If you want to install the content of a directory like a package from the registry instead of creating a link, you would need to use the \fB\-\-install\-links\fP option\.
.
Example:
.P
.RS 2
.nf
npm install \.\./\.\./other\-package
npm install \.\./\.\./other\-package \-\-install\-links
npm install \./sub\-package
.fi
.RE
@@ -727,6 +727,18 @@ all workspaces via the \fBworkspaces\fP flag, will cause npm to operate only on
the specified workspaces, and not on the root project\.
.P
This value is not exported to the environment for child processes\.
.SS \fBinstall\-links\fP
.RS 0
.IP \(bu 2
Default: false
.IP \(bu 2
Type: Boolean
.RE
.P
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink\. This option has no effect on workspaces\.
.SS Algorithm
.P
Given a \fBpackage{dep}\fP structure: \fBA{B,C}, B{C}, C{D}\fP,
+12
View File
@@ -390,6 +390,18 @@ all workspaces via the \fBworkspaces\fP flag, will cause npm to operate only on
the specified workspaces, and not on the root project\.
.P
This value is not exported to the environment for child processes\.
.SS \fBinstall\-links\fP
.RS 0
.IP \(bu 2
Default: false
.IP \(bu 2
Type: Boolean
.RE
.P
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink\. This option has no effect on workspaces\.
.SS See Also
.RS 0
.IP \(bu 2
+13 -1
View File
@@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show:
.P
.RS 2
.nf
npm@8\.7\.0 /path/to/npm
npm@8\.8\.0 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
@@ -286,6 +286,18 @@ all workspaces via the \fBworkspaces\fP flag, will cause npm to operate only on
the specified workspaces, and not on the root project\.
.P
This value is not exported to the environment for child processes\.
.SS \fBinstall\-links\fP
.RS 0
.IP \(bu 2
Default: false
.IP \(bu 2
Type: Boolean
.RE
.P
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink\. This option has no effect on workspaces\.
.SS See Also
.RS 0
.IP \(bu 2
+12
View File
@@ -186,6 +186,18 @@ all workspaces via the \fBworkspaces\fP flag, will cause npm to operate only on
the specified workspaces, and not on the root project\.
.P
This value is not exported to the environment for child processes\.
.SS \fBinstall\-links\fP
.RS 0
.IP \(bu 2
Default: false
.IP \(bu 2
Type: Boolean
.RE
.P
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink\. This option has no effect on workspaces\.
.SS See Also
.RS 0
.IP \(bu 2
+12
View File
@@ -159,6 +159,18 @@ all workspaces via the \fBworkspaces\fP flag, will cause npm to operate only on
the specified workspaces, and not on the root project\.
.P
This value is not exported to the environment for child processes\.
.SS \fBinstall\-links\fP
.RS 0
.IP \(bu 2
Default: false
.IP \(bu 2
Type: Boolean
.RE
.P
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink\. This option has no effect on workspaces\.
.SS See Also
.RS 0
.IP \(bu 2
+12
View File
@@ -140,6 +140,18 @@ all workspaces via the \fBworkspaces\fP flag, will cause npm to operate only on
the specified workspaces, and not on the root project\.
.P
This value is not exported to the environment for child processes\.
.SS \fBinstall\-links\fP
.RS 0
.IP \(bu 2
Default: false
.IP \(bu 2
Type: Boolean
.RE
.P
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink\. This option has no effect on workspaces\.
.SS See Also
.RS 0
.IP \(bu 2
+12
View File
@@ -440,6 +440,18 @@ all workspaces via the \fBworkspaces\fP flag, will cause npm to operate only on
the specified workspaces, and not on the root project\.
.P
This value is not exported to the environment for child processes\.
.SS \fBinstall\-links\fP
.RS 0
.IP \(bu 2
Default: false
.IP \(bu 2
Type: Boolean
.RE
.P
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink\. This option has no effect on workspaces\.
.SS See Also
.RS 0
.IP \(bu 2
+1 -1
View File
@@ -4,7 +4,7 @@
.SS Synopsis
.SS Version
.P
8\.7\.0
8\.8\.0
.SS Description
.P
npm is the package manager for the Node JavaScript platform\. It puts
+14
View File
@@ -173,6 +173,8 @@ Type: null or String
.RE
.P
A basic\-auth string to use when authenticating against the npm registry\.
This will ONLY be used to authenticate against the npm registry\. For other
registries you will need to scope it like "//other\-registry\.tld/:_auth"
.P
Warning: This should generally not be set via a command\-line option\. It is
safer to use a registry\-provided authentication bearer token stored in the
@@ -947,6 +949,18 @@ Type: SemVer string
.P
The value that \fBnpm init\fP should use by default for the package version
number, if not already set in package\.json\.
.SS \fBinstall\-links\fP
.RS 0
.IP \(bu 2
Default: false
.IP \(bu 2
Type: Boolean
.RE
.P
When set file: protocol dependencies that exist outside of the project root
will be packed and installed as regular dependencies instead of creating a
symlink\. This option has no effect on workspaces\.
.SS \fBjson\fP
.RS 0
.IP \(bu 2
+21 -3
View File
@@ -80,9 +80,27 @@ registry\.
If you wish, you may associate a scope with a registry; see below\.
.SS Publishing public scoped packages to the primary npm registry
.P
To publish a public scoped package, you must specify \fB\-\-access public\fP with
the initial publication\. This will publish the package and set access
to \fBpublic\fP as if you had run \fBnpm access public\fP after publishing\.
Publishing to a scope, you have two options:
.RS 0
.IP \(bu 2
Publishing to your user scope (example: \fB@username/module\fP)
.IP \(bu 2
Publishing to an organization scope (example: \fB@org/module\fP)
.RE
.P
If publishing a public module to an organization scope, you must
first either create an organization with the name of the scope
that you'd like to publish to or be added to an existing organization
with the appropriate permisssions\. For example, if you'd like to
publish to \fB@org\fP, you would need to create the \fBorg\fP organization
on npmjs\.com prior to trying to publish\.
.P
Scoped packages are not public by default\. You will need to specify
\fB\-\-access public\fP with the initial \fBnpm publish\fP command\. This will publish
the package and set access to \fBpublic\fP as if you had run \fBnpm access public\fP
after publishing\. You do not need to do this when publishing new versions of
an existing scoped package\.
.SS Publishing private scoped packages to the npm registry
.P
To publish a private scoped package to the npm registry, you must have
@@ -5,6 +5,7 @@ Original Library
Additional Functionality
- Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
- Copyright (c) DABH (https://github.com/DABH)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -29,6 +29,7 @@ console.log('Background color attack!'.black.bgWhite);
console.log('Use random styles on everything!'.random);
console.log('America, Heck Yeah!'.america);
// eslint-disable-next-line max-len
console.log('Blindingly '.brightCyan + 'bright? '.brightRed + 'Why '.brightYellow + 'not?!'.brightGreen);
console.log('Setting themes is useful');
@@ -79,4 +80,3 @@ console.log('this is a warning'.warn);
console.log('this is an input'.input);
// console.log("Don't summon".zalgo)
@@ -28,6 +28,7 @@ console.log(colors.black.bgWhite('Background color attack!'));
console.log(colors.random('Use random styles on everything!'));
console.log(colors.america('America, Heck Yeah!'));
// eslint-disable-next-line max-len
console.log(colors.brightCyan('Blindingly ') + colors.brightRed('bright? ') + colors.brightYellow('Why ') + colors.brightGreen('not?!'));
console.log('Setting themes is useful');
@@ -75,5 +76,3 @@ console.log(colors.warn('this is a warning'));
console.log(colors.input('this is an input'));
// console.log(colors.zalgo("Don't summon him"))
@@ -1,7 +1,7 @@
// Type definitions for Colors.js 1.2
// Type definitions for @colors/colors 1.4+
// Project: https://github.com/Marak/colors.js
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>, Staffan Eketorp <https://github.com/staeke>
// Definitions: https://github.com/Marak/colors.js
// Definitions: https://github.com/DABH/colors.js
export interface Color {
(text: string): string;
@@ -65,7 +65,7 @@ var stylize = colors.stylize = function stylize(str, style) {
var styleMap = ansiStyles[style];
// Stylize should work for non-ANSI styles, too
if(!styleMap && style in colors){
if (!styleMap && style in colors) {
// Style maps like trap operate as functions on strings;
// they don't have properties like open or close.
return colors[style](str);
File renamed without changes.
@@ -107,4 +107,3 @@ module['exports'] = function zalgo(text, options) {
// don't summon him
return heComes(text, options);
};
File renamed without changes.
File renamed without changes.
@@ -9,4 +9,3 @@ module['exports'] = function(colors) {
}
};
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,16 +1,16 @@
{
"name": "colors",
"name": "@colors/colors",
"description": "get colors in your node.js console",
"version": "1.4.0",
"author": "Marak Squires",
"version": "1.5.0",
"author": "DABH",
"contributors": [
{
"name": "DABH",
"url": "https://github.com/DABH"
}
],
"homepage": "https://github.com/Marak/colors.js",
"bugs": "https://github.com/Marak/colors.js/issues",
"homepage": "https://github.com/DABH/colors.js",
"bugs": "https://github.com/DABH/colors.js/issues",
"keywords": [
"ansi",
"terminal",
@@ -18,12 +18,12 @@
],
"repository": {
"type": "git",
"url": "http://github.com/Marak/colors.js.git"
"url": "http://github.com/DABH/colors.js.git"
},
"license": "MIT",
"scripts": {
"lint": "eslint . --fix",
"test": "node tests/basic-test.js && node tests/safe-test.js"
"test": "export FORCE_COLOR=1 && node tests/basic-test.js && node tests/safe-test.js"
},
"engines": {
"node": ">=0.1.90"
File renamed without changes.
File renamed without changes.
+15 -7
View File
@@ -124,6 +124,7 @@ module.exports = cls => class IdealTreeBuilder extends cls {
globalStyle = false,
idealTree = null,
includeWorkspaceRoot = false,
installLinks = false,
legacyPeerDeps = false,
packageLock = true,
strictPeerDeps = false,
@@ -135,6 +136,7 @@ module.exports = cls => class IdealTreeBuilder extends cls {
this[_strictPeerDeps] = !!strictPeerDeps
this.idealTree = idealTree
this.installLinks = installLinks
this.legacyPeerDeps = legacyPeerDeps
this[_usePackageLock] = packageLock
@@ -410,6 +412,7 @@ Try using the package name instead, e.g:
peer: false,
optional: false,
global: this[_global],
installLinks: this.installLinks,
legacyPeerDeps: this.legacyPeerDeps,
loadOverrides: true,
})
@@ -424,6 +427,7 @@ Try using the package name instead, e.g:
peer: false,
optional: false,
global: this[_global],
installLinks: this.installLinks,
legacyPeerDeps: this.legacyPeerDeps,
root,
})
@@ -992,6 +996,7 @@ This is a one-time fix-up, please be patient...
preferDedupe: this[_preferDedupe],
legacyBundling: this[_legacyBundling],
strictPeerDeps: this[_strictPeerDeps],
installLinks: this.installLinks,
legacyPeerDeps: this.legacyPeerDeps,
globalStyle: this[_globalStyle],
}))
@@ -1151,6 +1156,7 @@ This is a one-time fix-up, please be patient...
const vr = new Node({
path: node.realpath,
sourceReference: node,
installLinks: this.installLinks,
legacyPeerDeps: this.legacyPeerDeps,
overrides: node.overrides,
})
@@ -1268,17 +1274,18 @@ This is a one-time fix-up, please be patient...
// the object so it doesn't get mutated.
// Don't bother to load the manifest for link deps, because the target
// might be within another package that doesn't exist yet.
const { legacyPeerDeps } = this
const { installLinks, legacyPeerDeps } = this
const isWorkspace = this.idealTree.workspaces && this.idealTree.workspaces.has(spec.name)
// spec is a directory, link it
if (spec.type === 'directory') {
// spec is a directory, link it unless installLinks is set or it's a workspace
if (spec.type === 'directory' && (isWorkspace || !installLinks)) {
return this[_linkFromSpec](name, spec, parent, edge)
}
// if the spec matches a workspace name, then see if the workspace node will
// satisfy the edge. if it does, we return the workspace node to make sure it
// takes priority.
if (this.idealTree.workspaces && this.idealTree.workspaces.has(spec.name)) {
if (isWorkspace) {
const existingNode = this.idealTree.edgesOut.get(spec.name).to
if (existingNode && existingNode.isWorkspace && existingNode.satisfies(edge)) {
return edge.to
@@ -1288,7 +1295,7 @@ This is a one-time fix-up, please be patient...
// spec isn't a directory, and either isn't a workspace or the workspace we have
// doesn't satisfy the edge. try to fetch a manifest and build a node from that.
return this[_fetchManifest](spec)
.then(pkg => new Node({ name, pkg, parent, legacyPeerDeps }), error => {
.then(pkg => new Node({ name, pkg, parent, installLinks, legacyPeerDeps }), error => {
error.requiredBy = edge.from.location || '.'
// failed to load the spec, either because of enotarget or
@@ -1298,6 +1305,7 @@ This is a one-time fix-up, please be patient...
name,
parent,
error,
installLinks,
legacyPeerDeps,
})
this[_loadFailures].add(n)
@@ -1307,9 +1315,9 @@ This is a one-time fix-up, please be patient...
[_linkFromSpec] (name, spec, parent, edge) {
const realpath = spec.fetchSpec
const { legacyPeerDeps } = this
const { installLinks, legacyPeerDeps } = this
return rpj(realpath + '/package.json').catch(() => ({})).then(pkg => {
const link = new Link({ name, parent, realpath, pkg, legacyPeerDeps })
const link = new Link({ name, parent, realpath, pkg, installLinks, legacyPeerDeps })
this[_linkNodes].add(link)
return link
})
+1
View File
@@ -283,6 +283,7 @@ module.exports = cls => class ActualLoader extends cls {
.then(pkg => [pkg, null], error => [null, error])
.then(([pkg, error]) => {
return this[normalize(path) === real ? _newNode : _newLink]({
installLinks: this.installLinks,
legacyPeerDeps: this.legacyPeerDeps,
path,
realpath: real,
+2
View File
@@ -278,6 +278,7 @@ module.exports = cls => class VirtualLoader extends cls {
const peer = sw.peer
const node = new Node({
installLinks: this.installLinks,
legacyPeerDeps: this.legacyPeerDeps,
root: this.virtualTree,
path,
@@ -304,6 +305,7 @@ module.exports = cls => class VirtualLoader extends cls {
[loadLink] (location, targetLoc, target, meta) {
const path = resolve(this.path, location)
const link = new Link({
installLinks: this.installLinks,
legacyPeerDeps: this.legacyPeerDeps,
path,
realpath: resolve(this.path, targetLoc),
+13 -3
View File
@@ -53,9 +53,7 @@ const depValid = (child, requested, requestor) => {
return semver.satisfies(child.version, requested.fetchSpec, true)
case 'directory':
// directory must be a link to the specified folder
return !!child.isLink &&
relative(child.realpath, requested.fetchSpec) === ''
return linkValid(child, requested, requestor)
case 'file':
return tarballValid(child, requested, requestor)
@@ -108,6 +106,18 @@ const depValid = (child, requested, requestor) => {
return false
}
const linkValid = (child, requested, requestor) => {
const isLink = !!child.isLink
// if we're installing links and the node is a link, then it's invalid because we want
// a real node to be there
if (requestor.installLinks) {
return !isLink
}
// directory must be a link to the specified folder
return isLink && relative(child.realpath, requested.fetchSpec) === ''
}
const tarballValid = (child, requested, requestor) => {
if (child.isLink) {
return false
+5
View File
@@ -86,6 +86,7 @@ class Node {
name,
children,
fsChildren,
installLinks = false,
legacyPeerDeps = false,
linksIn,
hasShrinkwrap,
@@ -152,6 +153,7 @@ class Node {
}
this.integrity = integrity || pkg._integrity || null
this.hasShrinkwrap = hasShrinkwrap || pkg._hasShrinkwrap || false
this.installLinks = installLinks
this.legacyPeerDeps = legacyPeerDeps
this.children = new CaseInsensitiveMap()
@@ -1149,6 +1151,9 @@ class Node {
for (const kid of node.children.values()) {
kid.parent = this
}
if (node.isLink && node.target) {
node.target.root = null
}
}
if (!node.isRoot) {
+3
View File
@@ -45,6 +45,7 @@ class PlaceDep {
auditReport,
legacyBundling,
strictPeerDeps,
installLinks,
legacyPeerDeps,
globalStyle,
} = parent || options
@@ -56,6 +57,7 @@ class PlaceDep {
auditReport,
legacyBundling,
strictPeerDeps,
installLinks,
legacyPeerDeps,
globalStyle,
})
@@ -293,6 +295,7 @@ class PlaceDep {
pkg: dep.package,
resolved: dep.resolved,
integrity: dep.integrity,
installLinks: this.installLinks,
legacyPeerDeps: this.legacyPeerDeps,
error: dep.errors[0],
...(dep.overrides ? { overrides: dep.overrides } : {}),
+7 -7
View File
@@ -1,11 +1,11 @@
{
"name": "@npmcli/arborist",
"version": "5.0.6",
"version": "5.1.1",
"description": "Manage node_modules trees",
"dependencies": {
"@isaacs/string-locale-compare": "^1.1.0",
"@npmcli/installed-package-contents": "^1.0.7",
"@npmcli/map-workspaces": "^2.0.0",
"@npmcli/map-workspaces": "^2.0.3",
"@npmcli/metavuln-calculator": "^3.0.1",
"@npmcli/move-file": "^2.0.0",
"@npmcli/name-from-folder": "^1.0.1",
@@ -13,7 +13,7 @@
"@npmcli/package-json": "^2.0.0",
"@npmcli/run-script": "^3.0.0",
"bin-links": "^3.0.0",
"cacache": "^16.0.0",
"cacache": "^16.0.6",
"common-ancestor-path": "^1.0.1",
"json-parse-even-better-errors": "^2.3.1",
"json-stringify-nice": "^1.1.4",
@@ -24,7 +24,7 @@
"npm-package-arg": "^9.0.0",
"npm-pick-manifest": "^7.0.0",
"npm-registry-fetch": "^13.0.0",
"npmlog": "^6.0.1",
"npmlog": "^6.0.2",
"pacote": "^13.0.5",
"parse-conflict-json": "^2.0.1",
"proc-log": "^2.0.0",
@@ -33,14 +33,14 @@
"read-package-json-fast": "^2.0.2",
"readdir-scoped-modules": "^1.1.0",
"rimraf": "^3.0.2",
"semver": "^7.3.5",
"semver": "^7.3.7",
"ssri": "^9.0.0",
"treeverse": "^2.0.0",
"walk-up-path": "^1.0.0"
},
"devDependencies": {
"@npmcli/eslint-config": "^3.0.1",
"@npmcli/template-oss": "3.3.2",
"@npmcli/template-oss": "3.4.2",
"benchmark": "^2.1.4",
"chalk": "^4.1.0",
"minify-registry-metadata": "^2.1.0",
@@ -101,6 +101,6 @@
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "3.3.2"
"version": "3.4.2"
}
}
+17 -13
View File
@@ -1,16 +1,19 @@
{
"name": "@npmcli/map-workspaces",
"version": "2.0.2",
"version": "2.0.3",
"main": "lib/index.js",
"files": [
"bin",
"lib"
"bin/",
"lib/"
],
"engines": {
"node": "^12.13.0 || ^14.15.0 || >=16"
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
},
"description": "Retrieves a name:pathname Map for a given workspaces config",
"repository": "https://github.com/npm/map-workspaces",
"repository": {
"type": "git",
"url": "https://github.com/npm/map-workspaces.git"
},
"keywords": [
"npm",
"npmcli",
@@ -22,33 +25,34 @@
"author": "GitHub Inc.",
"license": "ISC",
"scripts": {
"lint": "eslint '**/*.js'",
"lint": "eslint \"**/*.js\"",
"pretest": "npm run lint",
"test": "tap",
"snap": "tap",
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
"postlint": "npm-template-check",
"postlint": "template-oss-check",
"lintfix": "npm run lint -- --fix",
"posttest": "npm run lint",
"template-copy": "npm-template-copy --force"
"template-oss-apply": "template-oss-apply --force"
},
"tap": {
"check-coverage": true
},
"devDependencies": {
"@npmcli/template-oss": "^2.9.2",
"eslint": "^8.10.0",
"tap": "^15.1.6"
"@npmcli/eslint-config": "^3.0.1",
"@npmcli/template-oss": "3.4.1",
"tap": "^16.0.1"
},
"dependencies": {
"@npmcli/name-from-folder": "^1.0.1",
"glob": "^7.2.0",
"glob": "^8.0.1",
"minimatch": "^5.0.1",
"read-package-json-fast": "^2.0.3"
},
"templateOSS": {
"version": "2.9.2"
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "3.4.1"
}
}
+3 -1
View File
@@ -13,6 +13,8 @@ const path = require('path')
const rimraf = util.promisify(require('rimraf'))
const ssri = require('ssri')
const globify = pattern => pattern.split('\\').join('/')
const hasOwnProperty = (obj, key) =>
Object.prototype.hasOwnProperty.call(obj, key)
@@ -119,7 +121,7 @@ function garbageCollect (cache, opts) {
indexStream.on('end', resolve).on('error', reject)
}).then(() => {
const contentDir = contentPath.contentDir(cache)
return glob(path.join(contentDir, '**'), {
return glob(globify(path.join(contentDir, '**')), {
follow: false,
nodir: true,
nosort: true,
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "cacache",
"version": "16.0.4",
"version": "16.0.6",
"cache-version": {
"content": "2",
"index": "5"
@@ -53,7 +53,7 @@
"@npmcli/move-file": "^2.0.0",
"chownr": "^2.0.0",
"fs-minipass": "^2.1.0",
"glob": "^7.2.0",
"glob": "^8.0.1",
"infer-owner": "^1.0.4",
"lru-cache": "^7.7.1",
"minipass": "^3.1.6",
@@ -70,7 +70,7 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^3.0.1",
"@npmcli/template-oss": "3.2.2",
"@npmcli/template-oss": "3.4.1",
"benchmark": "^2.1.4",
"chalk": "^4.1.2",
"require-inject": "^1.4.4",
@@ -87,7 +87,7 @@
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"windowsCI": false,
"version": "3.2.2"
"version": "3.4.1"
},
"author": "GitHub Inc."
}
+1
View File
@@ -27,6 +27,7 @@ declare namespace CliTable3 {
rowAligns: VerticalAlignment[];
head: string[];
wordWrap: boolean;
wrapOnWordBoundary: boolean;
}
interface TableInstanceOptions extends TableOptions {
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "cli-table3",
"version": "0.6.1",
"version": "0.6.2",
"description": "Pretty unicode tables for the command line. Based on the original cli-table.",
"main": "index.js",
"types": "index.d.ts",
@@ -16,8 +16,8 @@
"string-width": "^4.2.0"
},
"devDependencies": {
"ansi-256-colors": "^1.1.0",
"cli-table": "^0.3.1",
"eslint": "^6.0.0",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-prettier": "^3.0.0",
"jest": "^25.2.4",
@@ -26,7 +26,7 @@
"prettier": "2.3.2"
},
"optionalDependencies": {
"colors": "1.4.0"
"@colors/colors": "1.5.0"
},
"scripts": {
"changelog": "lerna-changelog",
@@ -75,7 +75,7 @@
{
"displayName": "test",
"testMatch": [
"<rootDir>/test/*.js"
"<rootDir>/test/**/*.js"
]
},
{
+54 -19
View File
@@ -1,3 +1,4 @@
const { info, debug } = require('./debug');
const utils = require('./utils');
class Cell {
@@ -30,12 +31,19 @@ class Cell {
if (['boolean', 'number', 'string'].indexOf(typeof content) !== -1) {
this.content = String(content);
} else if (!content) {
this.content = '';
this.content = this.options.href || '';
} else {
throw new Error('Content needs to be a primitive, got: ' + typeof content);
}
this.colSpan = options.colSpan || 1;
this.rowSpan = options.rowSpan || 1;
if (this.options.href) {
Object.defineProperty(this, 'href', {
get() {
return this.options.href;
},
});
}
}
mergeTableOptions(tableOptions, cells) {
@@ -57,25 +65,37 @@ class Cell {
this.head = style.head || tableStyle.head;
this.border = style.border || tableStyle.border;
let fixedWidth = tableOptions.colWidths[this.x];
if (tableOptions.wordWrap && fixedWidth) {
fixedWidth -= this.paddingLeft + this.paddingRight;
if (this.colSpan) {
let i = 1;
while (i < this.colSpan) {
fixedWidth += tableOptions.colWidths[this.x + i];
i++;
}
}
this.lines = utils.colorizeLines(utils.wordWrap(fixedWidth, this.content));
} else {
this.lines = utils.colorizeLines(this.content.split('\n'));
}
this.fixedWidth = tableOptions.colWidths[this.x];
this.lines = this.computeLines(tableOptions);
this.desiredWidth = utils.strlen(this.content) + this.paddingLeft + this.paddingRight;
this.desiredHeight = this.lines.length;
}
computeLines(tableOptions) {
if (this.fixedWidth && (tableOptions.wordWrap || tableOptions.textWrap)) {
this.fixedWidth -= this.paddingLeft + this.paddingRight;
if (this.colSpan) {
let i = 1;
while (i < this.colSpan) {
this.fixedWidth += tableOptions.colWidths[this.x + i];
i++;
}
}
const { wrapOnWordBoundary = true } = tableOptions;
return this.wrapLines(utils.wordWrap(this.fixedWidth, this.content, wrapOnWordBoundary));
}
return this.wrapLines(this.content.split('\n'));
}
wrapLines(computedLines) {
const lines = utils.colorizeLines(computedLines);
if (this.href) {
return lines.map((line) => utils.hyperlink(this.href, line));
}
return lines;
}
/**
* Initializes the Cells data structure.
*
@@ -110,6 +130,12 @@ class Cell {
draw(lineNum, spanningCell) {
if (lineNum == 'top') return this.drawTop(this.drawRight);
if (lineNum == 'bottom') return this.drawBottom(this.drawRight);
let content = utils.truncate(this.content, 10, this.truncate);
if (!lineNum) {
info(`${this.y}-${this.x}: ${this.rowSpan - lineNum}x${this.colSpan} Cell ${content}`);
} else {
// debug(`${lineNum}-${this.x}: 1x${this.colSpan} RowSpanCell ${content}`);
}
let padLen = Math.max(this.height - this.lines.length, 0);
let padTop;
switch (this.vAlign) {
@@ -186,7 +212,7 @@ class Cell {
wrapWithStyleColors(styleProperty, content) {
if (this[styleProperty] && this[styleProperty].length) {
try {
let colors = require('colors/safe');
let colors = require('@colors/colors/safe');
for (let i = this[styleProperty].length - 1; i >= 0; i--) {
colors = colors[this[styleProperty][i]];
}
@@ -285,7 +311,10 @@ class ColSpanCell {
*/
constructor() {}
draw() {
draw(lineNum) {
if (typeof lineNum === 'number') {
debug(`${this.y}-${this.x}: 1x1 ColSpanCell`);
}
return '';
}
@@ -319,21 +348,26 @@ class RowSpanCell {
if (lineNum == 'bottom') {
return this.originalCell.draw('bottom');
}
debug(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`);
return this.originalCell.draw(this.offset + 1 + lineNum);
}
mergeTableOptions() {}
}
function firstDefined(...args) {
return args.filter((v) => v !== undefined && v !== null).shift();
}
// HELPER FUNCTIONS
function setOption(objA, objB, nameB, targetObj) {
let nameA = nameB.split('-');
if (nameA.length > 1) {
nameA[1] = nameA[1].charAt(0).toUpperCase() + nameA[1].substr(1);
nameA = nameA.join('');
targetObj[nameA] = objA[nameA] || objA[nameB] || objB[nameA] || objB[nameB];
targetObj[nameA] = firstDefined(objA[nameA], objA[nameB], objB[nameA], objB[nameB]);
} else {
targetObj[nameB] = objA[nameB] || objB[nameB];
targetObj[nameB] = firstDefined(objA[nameB], objB[nameB]);
}
}
@@ -366,6 +400,7 @@ let CHAR_NAMES = [
'right-mid',
'middle',
];
module.exports = Cell;
module.exports.ColSpanCell = ColSpanCell;
module.exports.RowSpanCell = RowSpanCell;
+28
View File
@@ -0,0 +1,28 @@
let messages = [];
let level = 0;
const debug = (msg, min) => {
if (level >= min) {
messages.push(msg);
}
};
debug.WARN = 1;
debug.INFO = 2;
debug.DEBUG = 3;
debug.reset = () => {
messages = [];
};
debug.setDebugLevel = (v) => {
level = v;
};
debug.warn = (msg) => debug(msg, debug.WARN);
debug.info = (msg) => debug(msg, debug.INFO);
debug.debug = (msg) => debug(msg, debug.DEBUG);
debug.debugMessages = () => messages;
module.exports = debug;
+39 -18
View File
@@ -1,24 +1,35 @@
const { warn, debug } = require('./debug');
const Cell = require('./cell');
const { ColSpanCell, RowSpanCell } = Cell;
(function () {
function next(alloc, col) {
if (alloc[col] > 0) {
return next(alloc, col + 1);
}
return col;
}
function layoutTable(table) {
let alloc = {};
table.forEach(function (row, rowIndex) {
let prevCell = null;
row.forEach(function (cell, columnIndex) {
let col = 0;
row.forEach(function (cell) {
cell.y = rowIndex;
cell.x = prevCell ? prevCell.x + 1 : columnIndex;
for (let y = rowIndex; y >= 0; y--) {
let row2 = table[y];
let xMax = y === rowIndex ? columnIndex : row2.length;
for (let x = 0; x < xMax; x++) {
let cell2 = row2[x];
while (cellsConflict(cell, cell2)) {
cell.x++;
}
// Avoid erroneous call to next() on first row
cell.x = rowIndex ? next(alloc, col) : col;
const rowSpan = cell.rowSpan || 1;
const colSpan = cell.colSpan || 1;
if (rowSpan > 1) {
for (let cs = 0; cs < colSpan; cs++) {
alloc[cell.x + cs] = rowSpan;
}
prevCell = cell;
}
col = cell.x + colSpan;
});
Object.keys(alloc).forEach((idx) => {
alloc[idx]--;
if (alloc[idx] < 1) delete alloc[idx];
});
});
}
@@ -116,6 +127,7 @@ const { ColSpanCell, RowSpanCell } = Cell;
function fillInTable(table) {
let h_max = maxHeight(table);
let w_max = maxWidth(table);
debug(`Max rows: ${h_max}; Max cols: ${w_max}`);
for (let y = 0; y < h_max; y++) {
for (let x = 0; x < w_max; x++) {
if (!conflictExists(table, x, y)) {
@@ -130,10 +142,10 @@ const { ColSpanCell, RowSpanCell } = Cell;
opts.rowSpan++;
y2++;
}
let cell = new Cell(opts);
cell.x = opts.x;
cell.y = opts.y;
warn(`Missing cell at ${cell.y}-${cell.x}.`);
insertCell(cell, table[y]);
}
}
@@ -182,6 +194,7 @@ function makeComputeWidths(colSpan, desiredWidth, x, forcedMin) {
return function (vals, table) {
let result = [];
let spanners = [];
let auto = {};
table.forEach(function (row) {
row.forEach(function (cell) {
if ((cell[colSpan] || 1) > 1) {
@@ -205,12 +218,20 @@ function makeComputeWidths(colSpan, desiredWidth, x, forcedMin) {
let col = cell[x];
let existingWidth = result[col];
let editableCols = typeof vals[col] === 'number' ? 0 : 1;
for (let i = 1; i < span; i++) {
existingWidth += 1 + result[col + i];
if (typeof vals[col + i] !== 'number') {
editableCols++;
if (typeof existingWidth === 'number') {
for (let i = 1; i < span; i++) {
existingWidth += 1 + result[col + i];
if (typeof vals[col + i] !== 'number') {
editableCols++;
}
}
} else {
existingWidth = desiredWidth === 'desiredWidth' ? cell.desiredWidth - 1 : 1;
if (!auto[col] || auto[col] < existingWidth) {
auto[col] = existingWidth;
}
}
if (cell[desiredWidth] > existingWidth) {
let i = 0;
while (editableCols > 0 && cell[desiredWidth] > existingWidth) {
@@ -225,7 +246,7 @@ function makeComputeWidths(colSpan, desiredWidth, x, forcedMin) {
}
}
Object.assign(vals, result);
Object.assign(vals, result, auto);
for (let j = 0; j < vals.length; j++) {
vals[j] = Math.max(forcedMin, vals[j] || 0);
}
+31 -2
View File
@@ -1,11 +1,38 @@
const debug = require('./debug');
const utils = require('./utils');
const tableLayout = require('./layout-manager');
class Table extends Array {
constructor(options) {
constructor(opts) {
super();
this.options = utils.mergeOptions(options);
const options = utils.mergeOptions(opts);
Object.defineProperty(this, 'options', {
value: options,
enumerable: options.debug,
});
if (options.debug) {
switch (typeof options.debug) {
case 'boolean':
debug.setDebugLevel(debug.WARN);
break;
case 'number':
debug.setDebugLevel(options.debug);
break;
case 'string':
debug.setDebugLevel(parseInt(options.debug, 10));
break;
default:
debug.setDebugLevel(debug.WARN);
debug.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof options.debug}`);
}
Object.defineProperty(this, 'messages', {
get() {
return debug.debugMessages();
},
});
}
}
toString() {
@@ -65,6 +92,8 @@ class Table extends Array {
}
}
Table.reset = () => debug.reset();
function doDraw(row, lineNum, result) {
let line = [];
row.forEach(function (cell) {
+36 -2
View File
@@ -240,6 +240,7 @@ function mergeOptions(options, defaults) {
return ret;
}
// Wrap on word boundary
function wordWrap(maxLength, input) {
let lines = [];
let split = input.split(/(\s+)/g);
@@ -270,11 +271,32 @@ function wordWrap(maxLength, input) {
return lines;
}
function multiLineWordWrap(maxLength, input) {
// Wrap text (ignoring word boundaries)
function textWrap(maxLength, input) {
let lines = [];
let line = '';
function pushLine(str, ws) {
if (line.length && ws) line += ws;
line += str;
while (line.length > maxLength) {
lines.push(line.slice(0, maxLength));
line = line.slice(maxLength);
}
}
let split = input.split(/(\s+)/g);
for (let i = 0; i < split.length; i += 2) {
pushLine(split[i], i && split[i - 1]);
}
if (line.length) lines.push(line);
return lines;
}
function multiLineWordWrap(maxLength, input, wrapOnWordBoundary = true) {
let output = [];
input = input.split('\n');
const handler = wrapOnWordBoundary ? wordWrap : textWrap;
for (let i = 0; i < input.length; i++) {
output.push.apply(output, wordWrap(maxLength, input[i]));
output.push.apply(output, handler(maxLength, input[i]));
}
return output;
}
@@ -291,6 +313,17 @@ function colorizeLines(input) {
return output;
}
/**
* Credit: Matheus Sampaio https://github.com/matheussampaio
*/
function hyperlink(url, text) {
const OSC = '\u001B]';
const BEL = '\u0007';
const SEP = ';';
return [OSC, '8', SEP, SEP, url || text, BEL, text, OSC, '8', SEP, SEP, BEL].join('');
}
module.exports = {
strlen: strlen,
repeat: repeat,
@@ -299,4 +332,5 @@ module.exports = {
mergeOptions: mergeOptions,
wordWrap: multiLineWordWrap,
colorizeLines: colorizeLines,
hyperlink,
};
+1 -7
View File
@@ -1,6 +1,6 @@
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Copyright (c) 2009-2022 Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
@@ -13,9 +13,3 @@ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
## Glob Logo
Glob's logo created by Tanya Brassie <http://tanyabrassie.com/>, licensed
under a Creative Commons Attribution-ShareAlike 4.0 International License
https://creativecommons.org/licenses/by-sa/4.0/
+2
View File
@@ -110,6 +110,8 @@ function setopts (self, pattern, options) {
// Note that they are not supported in Glob itself anyway.
options.nonegate = true
options.nocomment = true
// always treat \ in patterns as escapes, not path separators
options.allowWindowsEscape = true
self.minimatch = new Minimatch(pattern, options)
self.options = self.minimatch.options
+4 -1
View File
@@ -342,7 +342,10 @@ Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
var read
if (prefix === null)
read = '.'
else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
else if (isAbsolute(prefix) ||
isAbsolute(pattern.map(function (p) {
return typeof p === 'string' ? p : '[*]'
}).join('/'))) {
if (!prefix || !isAbsolute(prefix))
prefix = '/' + prefix
read = prefix
+8 -4
View File
@@ -2,7 +2,7 @@
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"name": "glob",
"description": "a little globber",
"version": "7.2.0",
"version": "8.0.1",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/node-glob.git"
@@ -14,13 +14,13 @@
"common.js"
],
"engines": {
"node": "*"
"node": ">=12"
},
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"minimatch": "^5.0.1",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
@@ -28,12 +28,16 @@
"memfs": "^3.2.0",
"mkdirp": "0",
"rimraf": "^2.2.8",
"tap": "^15.0.6",
"tap": "^16.0.1",
"tick": "0.0.6"
},
"tap": {
"before": "test/00-setup.js",
"after": "test/zz-cleanup.js",
"statements": 90,
"branches": 90,
"functions": 90,
"lines": 90,
"jobs": 1
},
"scripts": {
+4 -1
View File
@@ -109,7 +109,10 @@ GlobSync.prototype._process = function (pattern, index, inGlobStar) {
var read
if (prefix === null)
read = '.'
else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
else if (isAbsolute(prefix) ||
isAbsolute(pattern.map(function (p) {
return typeof p === 'string' ? p : '[*]'
}).join('/'))) {
if (!prefix || !isAbsolute(prefix))
prefix = '/' + prefix
read = prefix
+2 -2
View File
@@ -20,7 +20,7 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^3.0.1",
"@npmcli/template-oss": "3.3.2",
"@npmcli/template-oss": "3.4.2",
"nock": "^13.2.4",
"tap": "^16.0.1"
},
@@ -46,6 +46,6 @@
],
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "3.3.2"
"version": "3.4.2"
}
}
Loaded 100 of 174 files, more files were not shown because too many files have changed in this diff. Show more