mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
deps: upgrade npm to 10.3.0
PR-URL: https://github.com/nodejs/node/pull/51431 Reviewed-By: Luke Karrys <luke@lukekarrys.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
This commit is contained in:
1 parent
8fdea67694
commit
c8876d765c
290 files changed
+1906
-17345
No files matched your search
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
# docs
|
||||
|
||||
[](https://github.com/npm/cli/actions/workflows/ci-docs.yml)
|
||||
|
||||
Scripts to build the npm docs.
|
||||
@@ -290,6 +290,16 @@ field of package.json, which comes from `process.platform`.
|
||||
|
||||
|
||||
|
||||
#### `libc`
|
||||
|
||||
* Default: null
|
||||
* Type: null or String
|
||||
|
||||
Override libc of native modules to install. Acceptable values are same as
|
||||
`libc` field of package.json
|
||||
|
||||
|
||||
|
||||
#### `workspace`
|
||||
|
||||
* Default:
|
||||
|
||||
+10
@@ -680,6 +680,16 @@ field of package.json, which comes from `process.platform`.
|
||||
|
||||
|
||||
|
||||
#### `libc`
|
||||
|
||||
* Default: null
|
||||
* Type: null or String
|
||||
|
||||
Override libc of native modules to install. Acceptable values are same as
|
||||
`libc` field of package.json
|
||||
|
||||
|
||||
|
||||
#### `workspace`
|
||||
|
||||
* Default:
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ packages will *also* show the paths to the specified packages. For
|
||||
example, running `npm ls promzard` in npm's source tree will show:
|
||||
|
||||
```bash
|
||||
npm@10.2.4 /path/to/npm
|
||||
npm@10.3.0 /path/to/npm
|
||||
└─┬ init-package-json@0.0.4
|
||||
└── promzard@0.1.5
|
||||
```
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ scope-configured registry (see
|
||||
|
||||
|
||||
A `package` is interpreted the same way as other commands (like
|
||||
`npm install` and can be:
|
||||
`npm install`) and can be:
|
||||
|
||||
* a) a folder containing a program described by a
|
||||
[`package.json`](/configuring-npm/package-json) file
|
||||
|
||||
+1
-1
@@ -266,7 +266,7 @@ SBOM format to use when generating SBOMs.
|
||||
* Type: "library", "application", or "framework"
|
||||
|
||||
The type of package described by the generated SBOM. For SPDX, this is the
|
||||
value for the `primaryPackagePurpose` fieled. For CycloneDX, this is the
|
||||
value for the `primaryPackagePurpose` field. For CycloneDX, this is the
|
||||
value for the `type` field.
|
||||
|
||||
|
||||
|
||||
+6
-2
@@ -27,8 +27,12 @@ removing the tarball.
|
||||
The npm registry will return an error if you are not [logged
|
||||
in](/commands/npm-adduser).
|
||||
|
||||
If you do not specify a version or if you remove all of a package's
|
||||
versions then the registry will remove the root package entry entirely.
|
||||
If you do not specify a package name at all, the name and version to be
|
||||
unpublished will be pulled from the project in the current directory.
|
||||
|
||||
If you specify a package name but do not specify a version or if you
|
||||
remove all of a package's versions then the registry will remove the
|
||||
root package entry entirely.
|
||||
|
||||
Even if you unpublish a package version, that specific name and version
|
||||
combination can never be reused. In order to publish the package again,
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ Note: This command is unaware of workspaces.
|
||||
|
||||
### Version
|
||||
|
||||
10.2.4
|
||||
10.3.0
|
||||
|
||||
### Description
|
||||
|
||||
|
||||
+2
-1
@@ -150,7 +150,8 @@ This resulted in some shifts in its functionality:
|
||||
always present in the executed process `PATH`.
|
||||
- The `--npm` option is removed. `npx` will always use the `npm` it ships
|
||||
with.
|
||||
- The `--node-arg` and `-n` options are removed.
|
||||
- The `--node-arg` and `-n` options have been removed. Use [`NODE_OPTIONS`](https://nodejs.org/api/cli.html#node_optionsoptions) instead: e.g.,
|
||||
`NODE_OPTIONS="--trace-warnings --trace-exit" npx foo --random=true`
|
||||
- The `--always-spawn` option is redundant, and thus removed.
|
||||
- The `--shell` option is replaced with `--script-shell`, but maintained
|
||||
in the `npx` executable for backwards compatibility.
|
||||
|
||||
+4
-4
@@ -19,10 +19,10 @@ For a list of available configuration options, see
|
||||
|
||||
The four relevant files are:
|
||||
|
||||
* per-project config file (/path/to/my/project/.npmrc)
|
||||
* per-user config file (~/.npmrc)
|
||||
* global config file ($PREFIX/etc/npmrc)
|
||||
* npm builtin config file (/path/to/npm/npmrc)
|
||||
* per-project config file (`/path/to/my/project/.npmrc`)
|
||||
* per-user config file (`~/.npmrc`)
|
||||
* global config file (`$PREFIX/etc/npmrc`)
|
||||
* npm builtin config file (`/path/to/npm/npmrc`)
|
||||
|
||||
All npm config files are an ini-formatted list of `key = value` parameters.
|
||||
Environment variables can be replaced using `${VARIABLE_NAME}`. For
|
||||
|
||||
+26
-12
@@ -291,25 +291,39 @@ Certain files are always included, regardless of settings:
|
||||
|
||||
`README` & `LICENSE` can have any case and extension.
|
||||
|
||||
Conversely, some files are always ignored:
|
||||
Some files are always ignored by default:
|
||||
|
||||
* `.git`
|
||||
* `CVS`
|
||||
* `.svn`
|
||||
* `.hg`
|
||||
* `.lock-wscript`
|
||||
* `.wafpickle-N`
|
||||
* `*.orig`
|
||||
* `.*.swp`
|
||||
* `.DS_Store`
|
||||
* `._*`
|
||||
* `.git`
|
||||
* `.hg`
|
||||
* `.lock-wscript`
|
||||
* `.npmrc`
|
||||
* `.svn`
|
||||
* `.wafpickle-N`
|
||||
* `CVS`
|
||||
* `config.gypi`
|
||||
* `node_modules`
|
||||
* `npm-debug.log`
|
||||
* `package-lock.json` (use
|
||||
[`npm-shrinkwrap.json`](/configuring-npm/npm-shrinkwrap-json)
|
||||
if you wish it to be published)
|
||||
* `pnpm-lock.yaml`
|
||||
* `yarn.lock`
|
||||
|
||||
Most of these ignored files can be included specifically if included in
|
||||
the `files` globs. Exceptions to this are:
|
||||
|
||||
* `.git`
|
||||
* `.npmrc`
|
||||
* `node_modules`
|
||||
* `config.gypi`
|
||||
* `*.orig`
|
||||
* `package-lock.json` (use
|
||||
[`npm-shrinkwrap.json`](/configuring-npm/npm-shrinkwrap-json) if you wish
|
||||
it to be published)
|
||||
* `package-lock.json`
|
||||
* `pnpm-lock.yaml`
|
||||
* `yarn.lock`
|
||||
|
||||
These can not be included.
|
||||
|
||||
### main
|
||||
|
||||
|
||||
+11
-1
@@ -855,6 +855,16 @@ Use of `legacy-peer-deps` is not recommended, as it will not enforce the
|
||||
|
||||
|
||||
|
||||
#### `libc`
|
||||
|
||||
* Default: null
|
||||
* Type: null or String
|
||||
|
||||
Override libc of native modules to install. Acceptable values are same as
|
||||
`libc` field of package.json
|
||||
|
||||
|
||||
|
||||
#### `link`
|
||||
|
||||
* Default: false
|
||||
@@ -1373,7 +1383,7 @@ SBOM format to use when generating SBOMs.
|
||||
* Type: "library", "application", or "framework"
|
||||
|
||||
The type of package described by the generated SBOM. For SPDX, this is the
|
||||
value for the `primaryPackagePurpose` fieled. For CycloneDX, this is the
|
||||
value for the `primaryPackagePurpose` field. For CycloneDX, this is the
|
||||
value for the `type` field.
|
||||
|
||||
|
||||
|
||||
Vendored
+189
@@ -0,0 +1,189 @@
|
||||
const localeCompare = require('@isaacs/string-locale-compare')('en')
|
||||
const { join, basename, resolve } = require('path')
|
||||
const transformHTML = require('./transform-html.js')
|
||||
const { version } = require('../../lib/npm.js')
|
||||
const { aliases } = require('../../lib/utils/cmd-list')
|
||||
const { shorthands, definitions } = require('@npmcli/config/lib/definitions')
|
||||
|
||||
const DOC_EXT = '.md'
|
||||
|
||||
const TAGS = {
|
||||
CONFIG: '<!-- AUTOGENERATED CONFIG DESCRIPTIONS -->',
|
||||
USAGE: '<!-- AUTOGENERATED USAGE DESCRIPTIONS -->',
|
||||
SHORTHANDS: '<!-- AUTOGENERATED CONFIG SHORTHANDS -->',
|
||||
}
|
||||
|
||||
const assertPlaceholder = (src, path, placeholder) => {
|
||||
if (!src.includes(placeholder)) {
|
||||
throw new Error(
|
||||
`Cannot replace ${placeholder} in ${path} due to missing placeholder`
|
||||
)
|
||||
}
|
||||
return placeholder
|
||||
}
|
||||
|
||||
const getCommandByDoc = (docFile, docExt) => {
|
||||
// Grab the command name from the *.md filename
|
||||
// NOTE: We cannot use the name property command file because in the case of
|
||||
// `npx` the file being used is `lib/commands/exec.js`
|
||||
const name = basename(docFile, docExt).replace('npm-', '')
|
||||
|
||||
if (name === 'npm') {
|
||||
return {
|
||||
name,
|
||||
params: null,
|
||||
usage: 'npm',
|
||||
}
|
||||
}
|
||||
|
||||
// special case for `npx`:
|
||||
// `npx` is not technically a command in and of itself,
|
||||
// so it just needs the usage of npm exex
|
||||
const srcName = name === 'npx' ? 'exec' : name
|
||||
const { params, usage = [''], workspaces } = require(`../../lib/commands/${srcName}`)
|
||||
const usagePrefix = name === 'npx' ? 'npx' : `npm ${name}`
|
||||
if (params) {
|
||||
for (const param of params) {
|
||||
if (definitions[param].exclusive) {
|
||||
for (const e of definitions[param].exclusive) {
|
||||
if (!params.includes(e)) {
|
||||
params.splice(params.indexOf(param) + 1, 0, e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
name,
|
||||
workspaces,
|
||||
params: name === 'npx' ? null : params,
|
||||
usage: usage.map(u => `${usagePrefix} ${u}`.trim()).join('\n'),
|
||||
}
|
||||
}
|
||||
|
||||
const replaceVersion = (src) => src.replace(/@VERSION@/g, version)
|
||||
|
||||
const replaceUsage = (src, { path }) => {
|
||||
const replacer = assertPlaceholder(src, path, TAGS.USAGE)
|
||||
const { usage, name, workspaces } = getCommandByDoc(path, DOC_EXT)
|
||||
|
||||
const synopsis = ['```bash', usage]
|
||||
|
||||
const cmdAliases = Object.keys(aliases).reduce((p, c) => {
|
||||
if (aliases[c] === name) {
|
||||
p.push(c)
|
||||
}
|
||||
return p
|
||||
}, [])
|
||||
|
||||
if (cmdAliases.length === 1) {
|
||||
synopsis.push('', `alias: ${cmdAliases[0]}`)
|
||||
} else if (cmdAliases.length > 1) {
|
||||
synopsis.push('', `aliases: ${cmdAliases.join(', ')}`)
|
||||
}
|
||||
|
||||
synopsis.push('```')
|
||||
|
||||
if (!workspaces) {
|
||||
synopsis.push('', 'Note: This command is unaware of workspaces.')
|
||||
}
|
||||
|
||||
return src.replace(replacer, synopsis.join('\n'))
|
||||
}
|
||||
|
||||
const replaceParams = (src, { path }) => {
|
||||
const { params } = getCommandByDoc(path, DOC_EXT)
|
||||
const replacer = params && assertPlaceholder(src, path, TAGS.CONFIG)
|
||||
|
||||
if (!params) {
|
||||
return src
|
||||
}
|
||||
|
||||
const paramsConfig = params.map((n) => definitions[n].describe())
|
||||
|
||||
return src.replace(replacer, paramsConfig.join('\n\n'))
|
||||
}
|
||||
|
||||
const replaceConfig = (src, { path }) => {
|
||||
const replacer = assertPlaceholder(src, path, TAGS.CONFIG)
|
||||
|
||||
// sort not-deprecated ones to the top
|
||||
/* istanbul ignore next - typically already sorted in the definitions file,
|
||||
* but this is here so that our help doc will stay consistent if we decide
|
||||
* to move them around. */
|
||||
const sort = ([keya, { deprecated: depa }], [keyb, { deprecated: depb }]) => {
|
||||
return depa && !depb ? 1
|
||||
: !depa && depb ? -1
|
||||
: localeCompare(keya, keyb)
|
||||
}
|
||||
|
||||
const allConfig = Object.entries(definitions).sort(sort)
|
||||
.map(([_, def]) => def.describe())
|
||||
.join('\n\n')
|
||||
|
||||
return src.replace(replacer, allConfig)
|
||||
}
|
||||
|
||||
const replaceShorthands = (src, { path }) => {
|
||||
const replacer = assertPlaceholder(src, path, TAGS.SHORTHANDS)
|
||||
|
||||
const sh = Object.entries(shorthands)
|
||||
.sort(([shorta, expansiona], [shortb, expansionb]) =>
|
||||
// sort by what they're short FOR
|
||||
localeCompare(expansiona.join(' '), expansionb.join(' ')) || localeCompare(shorta, shortb)
|
||||
)
|
||||
.map(([short, expansion]) => {
|
||||
// XXX: this is incorrect. we have multicharacter flags like `-iwr` that
|
||||
// can only be set with a single dash
|
||||
const dash = short.length === 1 ? '-' : '--'
|
||||
return `* \`${dash}${short}\`: \`${expansion.join(' ')}\``
|
||||
})
|
||||
|
||||
return src.replace(replacer, sh.join('\n'))
|
||||
}
|
||||
|
||||
const replaceHelpLinks = (src) => {
|
||||
// replaces markdown links with equivalent-ish npm help commands
|
||||
return src.replace(
|
||||
/\[`?([\w\s-]+)`?\]\(\/(?:commands|configuring-npm|using-npm)\/(?:[\w\s-]+)\)/g,
|
||||
(_, p1) => {
|
||||
const term = p1.replace(/npm\s/g, '').replace(/\s+/g, ' ').trim()
|
||||
const help = `npm help ${term.includes(' ') ? `"${term}"` : term}`
|
||||
return help
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
const transformMan = (src, { data, unified, remarkParse, remarkMan }) => unified()
|
||||
.use(remarkParse)
|
||||
.use(remarkMan)
|
||||
.processSync(`# ${data.title}(${data.section}) - ${data.description}\n\n${src}`)
|
||||
.toString()
|
||||
|
||||
const manPath = (name, { data }) => join(`man${data.section}`, `${name}.${data.section}`)
|
||||
|
||||
const transformMd = (src, { frontmatter }) => ['---', frontmatter, '---', '', src].join('\n')
|
||||
|
||||
module.exports = {
|
||||
DOC_EXT,
|
||||
TAGS,
|
||||
paths: {
|
||||
content: resolve(__dirname, 'content'),
|
||||
nav: resolve(__dirname, 'content', 'nav.yml'),
|
||||
template: resolve(__dirname, 'template.html'),
|
||||
man: resolve(__dirname, '..', '..', 'man'),
|
||||
html: resolve(__dirname, '..', 'output'),
|
||||
md: resolve(__dirname, '..', 'content'),
|
||||
},
|
||||
usage: replaceUsage,
|
||||
params: replaceParams,
|
||||
config: replaceConfig,
|
||||
shorthands: replaceShorthands,
|
||||
version: replaceVersion,
|
||||
helpLinks: replaceHelpLinks,
|
||||
man: transformMan,
|
||||
manPath: manPath,
|
||||
md: transformMd,
|
||||
html: transformHTML,
|
||||
}
|
||||
+8
-1
@@ -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="#install-strategy"><code>install-strategy</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#include"><code>include</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#prefer-dedupe"><code>prefer-dedupe</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#package-lock-only"><code>package-lock-only</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="#cpu"><code>cpu</code></a></li><li><a href="#os"><code>os</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>
|
||||
<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="#install-strategy"><code>install-strategy</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#include"><code>include</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#prefer-dedupe"><code>prefer-dedupe</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#package-lock-only"><code>package-lock-only</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="#cpu"><code>cpu</code></a></li><li><a href="#os"><code>os</code></a></li><li><a href="#libc"><code>libc</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>
|
||||
@@ -350,6 +350,13 @@ are same as <code>cpu</code> field of package.json, which comes from <code>proce
|
||||
</ul>
|
||||
<p>Override OS of native modules to install. Acceptable values are same as <code>os</code>
|
||||
field of package.json, which comes from <code>process.platform</code>.</p>
|
||||
<h4 id="libc"><code>libc</code></h4>
|
||||
<ul>
|
||||
<li>Default: null</li>
|
||||
<li>Type: null or String</li>
|
||||
</ul>
|
||||
<p>Override libc of native modules to install. Acceptable values are same as
|
||||
<code>libc</code> field of package.json</p>
|
||||
<h4 id="workspace"><code>workspace</code></h4>
|
||||
<ul>
|
||||
<li>Default:</li>
|
||||
|
||||
+8
-1
@@ -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="#install-strategy"><code>install-strategy</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#include"><code>include</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#prefer-dedupe"><code>prefer-dedupe</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#package-lock-only"><code>package-lock-only</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="#cpu"><code>cpu</code></a></li><li><a href="#os"><code>os</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>
|
||||
<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="#install-strategy"><code>install-strategy</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#include"><code>include</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#prefer-dedupe"><code>prefer-dedupe</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#package-lock-only"><code>package-lock-only</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="#cpu"><code>cpu</code></a></li><li><a href="#os"><code>os</code></a></li><li><a href="#libc"><code>libc</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>
|
||||
@@ -676,6 +676,13 @@ are same as <code>cpu</code> field of package.json, which comes from <code>proce
|
||||
</ul>
|
||||
<p>Override OS of native modules to install. Acceptable values are same as <code>os</code>
|
||||
field of package.json, which comes from <code>process.platform</code>.</p>
|
||||
<h4 id="libc"><code>libc</code></h4>
|
||||
<ul>
|
||||
<li>Default: null</li>
|
||||
<li>Type: null or String</li>
|
||||
</ul>
|
||||
<p>Override libc of native modules to install. Acceptable values are same as
|
||||
<code>libc</code> field of package.json</p>
|
||||
<h4 id="workspace"><code>workspace</code></h4>
|
||||
<ul>
|
||||
<li>Default:</li>
|
||||
|
||||
+1
-1
@@ -160,7 +160,7 @@ tree at all, use <a href="../commands/npm-explain.html"><code>npm explain</code>
|
||||
the results to only the paths to the packages named. Note that nested
|
||||
packages will <em>also</em> show the paths to the specified packages. For
|
||||
example, running <code>npm ls promzard</code> in npm's source tree will show:</p>
|
||||
<pre><code class="language-bash">npm@10.2.4 /path/to/npm
|
||||
<pre><code class="language-bash">npm@10.3.0 /path/to/npm
|
||||
└─┬ init-package-json@0.0.4
|
||||
└── promzard@0.1.5
|
||||
</code></pre>
|
||||
|
||||
+1
-1
@@ -156,7 +156,7 @@ overridden by specifying a different default registry or using a
|
||||
scope-configured registry (see
|
||||
<a href="../configuring-npm/package-json.html"><code>package.json</code></a>).</p>
|
||||
<p>A <code>package</code> is interpreted the same way as other commands (like
|
||||
<code>npm install</code> and can be:</p>
|
||||
<code>npm install</code>) and can be:</p>
|
||||
<ul>
|
||||
<li>a) a folder containing a program described by a
|
||||
<a href="../configuring-npm/package-json.html"><code>package.json</code></a> file</li>
|
||||
|
||||
+1
-1
@@ -379,7 +379,7 @@ instead of checking <code>node_modules</code> and downloading dependencies.</p>
|
||||
<li>Type: "library", "application", or "framework"</li>
|
||||
</ul>
|
||||
<p>The type of package described by the generated SBOM. For SPDX, this is the
|
||||
value for the <code>primaryPackagePurpose</code> fieled. For CycloneDX, this is the
|
||||
value for the <code>primaryPackagePurpose</code> field. For CycloneDX, this is the
|
||||
value for the <code>type</code> field.</p>
|
||||
<h4 id="workspace"><code>workspace</code></h4>
|
||||
<ul>
|
||||
|
||||
+5
-2
@@ -159,8 +159,11 @@ want to maintain a package.</p>
|
||||
removing the tarball.</p>
|
||||
<p>The npm registry will return an error if you are not <a href="../commands/npm-adduser.html">logged
|
||||
in</a>.</p>
|
||||
<p>If you do not specify a version or if you remove all of a package's
|
||||
versions then the registry will remove the root package entry entirely.</p>
|
||||
<p>If you do not specify a package name at all, the name and version to be
|
||||
unpublished will be pulled from the project in the current directory.</p>
|
||||
<p>If you specify a package name but do not specify a version or if you
|
||||
remove all of a package's versions then the registry will remove the
|
||||
root package entry entirely.</p>
|
||||
<p>Even if you unpublish a package version, that specific name and version
|
||||
combination can never be reused. In order to publish the package again,
|
||||
you must use a new version number. If you unpublish the entire package,
|
||||
|
||||
+1
-1
@@ -150,7 +150,7 @@ npm command-line interface
|
||||
</code></pre>
|
||||
<p>Note: This command is unaware of workspaces.</p>
|
||||
<h3 id="version">Version</h3>
|
||||
<p>10.2.4</p>
|
||||
<p>10.3.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
|
||||
|
||||
+2
-1
@@ -252,7 +252,8 @@ executable.</li>
|
||||
always present in the executed process <code>PATH</code>.</li>
|
||||
<li>The <code>--npm</code> option is removed. <code>npx</code> will always use the <code>npm</code> it ships
|
||||
with.</li>
|
||||
<li>The <code>--node-arg</code> and <code>-n</code> options are removed.</li>
|
||||
<li>The <code>--node-arg</code> and <code>-n</code> options have been removed. Use <a href="https://nodejs.org/api/cli.html#node_optionsoptions"><code>NODE_OPTIONS</code></a> instead: e.g.,
|
||||
<code>NODE_OPTIONS="--trace-warnings --trace-exit" npx foo --random=true</code></li>
|
||||
<li>The <code>--always-spawn</code> option is redundant, and thus removed.</li>
|
||||
<li>The <code>--shell</code> option is replaced with <code>--script-shell</code>, but maintained
|
||||
in the <code>npx</code> executable for backwards compatibility.</li>
|
||||
|
||||
+4
-4
@@ -155,10 +155,10 @@ user and global npmrc files.</p>
|
||||
<h3 id="files">Files</h3>
|
||||
<p>The four relevant files are:</p>
|
||||
<ul>
|
||||
<li>per-project config file (/path/to/my/project/.npmrc)</li>
|
||||
<li>per-user config file (~/.npmrc)</li>
|
||||
<li>global config file ($PREFIX/etc/npmrc)</li>
|
||||
<li>npm builtin config file (/path/to/npm/npmrc)</li>
|
||||
<li>per-project config file (<code>/path/to/my/project/.npmrc</code>)</li>
|
||||
<li>per-user config file (<code>~/.npmrc</code>)</li>
|
||||
<li>global config file (<code>$PREFIX/etc/npmrc</code>)</li>
|
||||
<li>npm builtin config file (<code>/path/to/npm/npmrc</code>)</li>
|
||||
</ul>
|
||||
<p>All npm config files are an ini-formatted list of <code>key = value</code> parameters.
|
||||
Environment variables can be replaced using <code>${VARIABLE_NAME}</code>. For
|
||||
|
||||
+25
-12
@@ -364,26 +364,39 @@ will be used instead.</p>
|
||||
<li>The file(s) in the "bin" field</li>
|
||||
</ul>
|
||||
<p><code>README</code> & <code>LICENSE</code> can have any case and extension.</p>
|
||||
<p>Conversely, some files are always ignored:</p>
|
||||
<p>Some files are always ignored by default:</p>
|
||||
<ul>
|
||||
<li><code>.git</code></li>
|
||||
<li><code>CVS</code></li>
|
||||
<li><code>.svn</code></li>
|
||||
<li><code>.hg</code></li>
|
||||
<li><code>.lock-wscript</code></li>
|
||||
<li><code>.wafpickle-N</code></li>
|
||||
<li><code>*.orig</code></li>
|
||||
<li><code>.*.swp</code></li>
|
||||
<li><code>.DS_Store</code></li>
|
||||
<li><code>._*</code></li>
|
||||
<li><code>.git</code></li>
|
||||
<li><code>.hg</code></li>
|
||||
<li><code>.lock-wscript</code></li>
|
||||
<li><code>.npmrc</code></li>
|
||||
<li><code>.svn</code></li>
|
||||
<li><code>.wafpickle-N</code></li>
|
||||
<li><code>CVS</code></li>
|
||||
<li><code>config.gypi</code></li>
|
||||
<li><code>node_modules</code></li>
|
||||
<li><code>npm-debug.log</code></li>
|
||||
<li><code>package-lock.json</code> (use
|
||||
<a href="../configuring-npm/npm-shrinkwrap-json.html"><code>npm-shrinkwrap.json</code></a>
|
||||
if you wish it to be published)</li>
|
||||
<li><code>pnpm-lock.yaml</code></li>
|
||||
<li><code>yarn.lock</code></li>
|
||||
</ul>
|
||||
<p>Most of these ignored files can be included specifically if included in
|
||||
the <code>files</code> globs. Exceptions to this are:</p>
|
||||
<ul>
|
||||
<li><code>.git</code></li>
|
||||
<li><code>.npmrc</code></li>
|
||||
<li><code>node_modules</code></li>
|
||||
<li><code>config.gypi</code></li>
|
||||
<li><code>*.orig</code></li>
|
||||
<li><code>package-lock.json</code> (use
|
||||
<a href="../configuring-npm/npm-shrinkwrap-json.html"><code>npm-shrinkwrap.json</code></a> if you wish
|
||||
it to be published)</li>
|
||||
<li><code>package-lock.json</code></li>
|
||||
<li><code>pnpm-lock.yaml</code></li>
|
||||
<li><code>yarn.lock</code></li>
|
||||
</ul>
|
||||
<p>These can not be included.</p>
|
||||
<h3 id="main">main</h3>
|
||||
<p>The main field is a module ID that is the primary entry point to your
|
||||
program. That is, if your package is named <code>foo</code>, and a user installs it,
|
||||
|
||||
+9
-2
@@ -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="#auth-type"><code>auth-type</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="#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="#cpu"><code>cpu</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="#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="#install-strategy"><code>install-strategy</code></a></li><li><a href="#json"><code>json</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="#noproxy"><code>noproxy</code></a></li><li><a href="#offline"><code>offline</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#omit-lockfile-registry-resolved"><code>omit-lockfile-registry-resolved</code></a></li><li><a href="#os"><code>os</code></a></li>Line 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="#auth-type"><code>auth-type</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="#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="#cpu"><code>cpu</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="#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="#install-strategy"><code>install-strategy</code></a></li><li><a href="#json"><code>json</code></a></li><li><a href="#legacy-peer-deps"><code>legacy-peer-deps</code></a></li><li><a href="#libc"><code>libc</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="#noproxy"><code>noproxy</code></a></li><li><a href="#offline"><code>offline</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#omit-lockfile-registry-resolved"><code>omit-lockfile-registry-resolved</code></a><Line truncated
|
||||
</section>
|
||||
|
||||
<div id="_content"><h3 id="description">Description</h3>
|
||||
@@ -764,6 +764,13 @@ that collide, it provides a way to move forward resolving the situation.</p>
|
||||
<code>peerDependencies</code> <em>could</em> be unpacked in a correct place.</p>
|
||||
<p>Use of <code>legacy-peer-deps</code> is not recommended, as it will not enforce the
|
||||
<code>peerDependencies</code> contract that meta-dependencies may rely on.</p>
|
||||
<h4 id="libc"><code>libc</code></h4>
|
||||
<ul>
|
||||
<li>Default: null</li>
|
||||
<li>Type: null or String</li>
|
||||
</ul>
|
||||
<p>Override libc of native modules to install. Acceptable values are same as
|
||||
<code>libc</code> field of package.json</p>
|
||||
<h4 id="link"><code>link</code></h4>
|
||||
<ul>
|
||||
<li>Default: false</li>
|
||||
@@ -1129,7 +1136,7 @@ or <code>--save-optional</code> are true.</p>
|
||||
<li>Type: "library", "application", or "framework"</li>
|
||||
</ul>
|
||||
<p>The type of package described by the generated SBOM. For SPDX, this is the
|
||||
value for the <code>primaryPackagePurpose</code> fieled. For CycloneDX, this is the
|
||||
value for the <code>primaryPackagePurpose</code> field. For CycloneDX, this is the
|
||||
value for the <code>type</code> field.</p>
|
||||
<h4 id="scope"><code>scope</code></h4>
|
||||
<ul>
|
||||
|
||||
Vendored
+1
@@ -37,6 +37,7 @@ class Install extends ArboristWorkspaceCmd {
|
||||
'dry-run',
|
||||
'cpu',
|
||||
'os',
|
||||
'libc',
|
||||
...super.params,
|
||||
]
|
||||
|
||||
|
||||
Vendored
+62
-49
@@ -1,7 +1,7 @@
|
||||
const libaccess = require('libnpmaccess')
|
||||
const libunpub = require('libnpmpublish').unpublish
|
||||
const npa = require('npm-package-arg')
|
||||
const npmFetch = require('npm-registry-fetch')
|
||||
const pacote = require('pacote')
|
||||
const pkgJson = require('@npmcli/package-json')
|
||||
|
||||
const { flatten } = require('@npmcli/config/lib/definitions')
|
||||
@@ -23,12 +23,12 @@ class Unpublish extends BaseCommand {
|
||||
static ignoreImplicitWorkspace = false
|
||||
|
||||
static async getKeysOfVersions (name, opts) {
|
||||
const pkgUri = npa(name).escapedName
|
||||
const json = await npmFetch.json(`${pkgUri}?write=true`, {
|
||||
const packument = await pacote.packument(name, {
|
||||
...opts,
|
||||
spec: name,
|
||||
query: { write: true },
|
||||
})
|
||||
return Object.keys(json.versions)
|
||||
return Object.keys(packument.versions)
|
||||
}
|
||||
|
||||
static async completion (args, npm) {
|
||||
@@ -59,7 +59,7 @@ class Unpublish extends BaseCommand {
|
||||
return pkgs
|
||||
}
|
||||
|
||||
const versions = await this.getKeysOfVersions(pkgs[0], opts)
|
||||
const versions = await Unpublish.getKeysOfVersions(pkgs[0], opts)
|
||||
if (!versions.length) {
|
||||
return pkgs
|
||||
} else {
|
||||
@@ -67,20 +67,35 @@ class Unpublish extends BaseCommand {
|
||||
}
|
||||
}
|
||||
|
||||
async exec (args) {
|
||||
async exec (args, { localPrefix } = {}) {
|
||||
if (args.length > 1) {
|
||||
throw this.usageError()
|
||||
}
|
||||
|
||||
let spec = args.length && npa(args[0])
|
||||
// workspace mode
|
||||
if (!localPrefix) {
|
||||
localPrefix = this.npm.localPrefix
|
||||
}
|
||||
|
||||
const force = this.npm.config.get('force')
|
||||
const { silent } = this.npm
|
||||
const dryRun = this.npm.config.get('dry-run')
|
||||
|
||||
let spec
|
||||
if (args.length) {
|
||||
spec = npa(args[0])
|
||||
if (spec.type !== 'version' && spec.rawSpec !== '*') {
|
||||
throw this.usageError(
|
||||
'Can only unpublish a single version, or the entire project.\n' +
|
||||
'Tags and ranges are not supported.'
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
log.silly('unpublish', 'args[0]', args[0])
|
||||
log.silly('unpublish', 'spec', spec)
|
||||
|
||||
if ((!spec || !spec.rawSpec) && !force) {
|
||||
if (spec?.rawSpec === '*' && !force) {
|
||||
throw this.usageError(
|
||||
'Refusing to delete entire project.\n' +
|
||||
'Run with --force to do this.'
|
||||
@@ -89,69 +104,67 @@ class Unpublish extends BaseCommand {
|
||||
|
||||
const opts = { ...this.npm.flatOptions }
|
||||
|
||||
let pkgName
|
||||
let pkgVersion
|
||||
let manifest
|
||||
let manifestErr
|
||||
try {
|
||||
const { content } = await pkgJson.prepare(this.npm.localPrefix)
|
||||
const { content } = await pkgJson.prepare(localPrefix)
|
||||
manifest = content
|
||||
} catch (err) {
|
||||
manifestErr = err
|
||||
if (err.code === 'ENOENT' || err.code === 'ENOTDIR') {
|
||||
if (!spec) {
|
||||
// We needed a local package.json to figure out what package to
|
||||
// unpublish
|
||||
throw this.usageError()
|
||||
}
|
||||
} else {
|
||||
// folks should know if ANY local package.json had a parsing error.
|
||||
// They may be relying on `publishConfig` to be loading and we don't
|
||||
// want to ignore errors in that case.
|
||||
throw err
|
||||
}
|
||||
}
|
||||
|
||||
let pkgVersion // for cli output
|
||||
if (spec) {
|
||||
// If cwd has a package.json with a name that matches the package being
|
||||
// unpublished, load up the publishConfig
|
||||
if (manifest && manifest.name === spec.name && manifest.publishConfig) {
|
||||
flatten(manifest.publishConfig, opts)
|
||||
}
|
||||
const versions = await Unpublish.getKeysOfVersions(spec.name, opts)
|
||||
if (versions.length === 1 && !force) {
|
||||
throw this.usageError(LAST_REMAINING_VERSION_ERROR)
|
||||
}
|
||||
pkgName = spec.name
|
||||
pkgVersion = spec.type === 'version' ? `@${spec.rawSpec}` : ''
|
||||
} else {
|
||||
if (manifestErr) {
|
||||
if (manifestErr.code === 'ENOENT' || manifestErr.code === 'ENOTDIR') {
|
||||
throw this.usageError()
|
||||
} else {
|
||||
throw manifestErr
|
||||
}
|
||||
}
|
||||
|
||||
log.verbose('unpublish', manifest)
|
||||
|
||||
spec = npa.resolve(manifest.name, manifest.version)
|
||||
if (manifest.publishConfig) {
|
||||
flatten(manifest.publishConfig, opts)
|
||||
}
|
||||
|
||||
pkgName = manifest.name
|
||||
log.verbose('unpublish', manifest)
|
||||
pkgVersion = manifest.version ? `@${manifest.version}` : ''
|
||||
if (!manifest.version && !force) {
|
||||
throw this.usageError(
|
||||
'Refusing to delete entire project.\n' +
|
||||
'Run with --force to do this.'
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// If localPrefix has a package.json with a name that matches the package
|
||||
// being unpublished, load up the publishConfig
|
||||
if (manifest?.name === spec.name && manifest.publishConfig) {
|
||||
flatten(manifest.publishConfig, opts)
|
||||
}
|
||||
|
||||
const versions = await Unpublish.getKeysOfVersions(spec.name, opts)
|
||||
if (versions.length === 1 && spec.rawSpec === versions[0] && !force) {
|
||||
throw this.usageError(LAST_REMAINING_VERSION_ERROR)
|
||||
}
|
||||
if (versions.length === 1) {
|
||||
pkgVersion = ''
|
||||
}
|
||||
|
||||
if (!dryRun) {
|
||||
await otplease(this.npm, opts, o => libunpub(spec, o))
|
||||
}
|
||||
if (!silent) {
|
||||
this.npm.output(`- ${pkgName}${pkgVersion}`)
|
||||
this.npm.output(`- ${spec.name}${pkgVersion}`)
|
||||
}
|
||||
}
|
||||
|
||||
async execWorkspaces (args) {
|
||||
await this.setWorkspaces()
|
||||
|
||||
const force = this.npm.config.get('force')
|
||||
if (!force) {
|
||||
throw this.usageError(
|
||||
'Refusing to delete entire project(s).\n' +
|
||||
'Run with --force to do this.'
|
||||
)
|
||||
}
|
||||
|
||||
for (const name of this.workspaceNames) {
|
||||
await this.exec([name])
|
||||
for (const path of this.workspacePaths) {
|
||||
await this.exec(args, { localPrefix: path })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+7
-7
@@ -392,20 +392,20 @@ class View extends BaseCommand {
|
||||
|
||||
if (info.keywords.length) {
|
||||
this.npm.output('')
|
||||
this.npm.output('keywords:', chalk.yellow(info.keywords.join(', ')))
|
||||
this.npm.output(`keywords: ${chalk.yellow(info.keywords.join(', '))}`)
|
||||
}
|
||||
|
||||
if (info.bins.length) {
|
||||
this.npm.output('')
|
||||
this.npm.output('bin:', chalk.yellow(info.bins.join(', ')))
|
||||
this.npm.output(`bin: ${chalk.yellow(info.bins.join(', '))}`)
|
||||
}
|
||||
|
||||
this.npm.output('')
|
||||
this.npm.output('dist')
|
||||
this.npm.output('.tarball:', info.tarball)
|
||||
this.npm.output('.shasum:', info.shasum)
|
||||
info.integrity && this.npm.output('.integrity:', info.integrity)
|
||||
info.unpackedSize && this.npm.output('.unpackedSize:', info.unpackedSize)
|
||||
this.npm.output(`.tarball: ${info.tarball}`)
|
||||
this.npm.output(`.shasum: ${info.shasum}`)
|
||||
info.integrity && this.npm.output(`.integrity: ${info.integrity}`)
|
||||
info.unpackedSize && this.npm.output(`.unpackedSize: ${info.unpackedSize}`)
|
||||
|
||||
const maxDeps = 24
|
||||
if (info.deps.length) {
|
||||
@@ -420,7 +420,7 @@ class View extends BaseCommand {
|
||||
if (info.maintainers && info.maintainers.length) {
|
||||
this.npm.output('')
|
||||
this.npm.output('maintainers:')
|
||||
info.maintainers.forEach((u) => this.npm.output('-', u))
|
||||
info.maintainers.forEach((u) => this.npm.output(`- ${u}`))
|
||||
}
|
||||
|
||||
this.npm.output('')
|
||||
|
||||
Vendored
+8
-6
@@ -216,11 +216,13 @@ class Npm {
|
||||
fs.mkdir(this.cache, { recursive: true })
|
||||
.catch((e) => log.verbose('cache', `could not create cache: ${e}`)))
|
||||
|
||||
// its ok if this fails. user might have specified an invalid dir
|
||||
// it's ok if this fails. user might have specified an invalid dir
|
||||
// which we will tell them about at the end
|
||||
await this.time('npm:load:mkdirplogs', () =>
|
||||
fs.mkdir(this.logsDir, { recursive: true })
|
||||
.catch((e) => log.verbose('logfile', `could not create logs-dir: ${e}`)))
|
||||
if (this.config.get('logs-max') > 0) {
|
||||
await this.time('npm:load:mkdirplogs', () =>
|
||||
fs.mkdir(this.logsDir, { recursive: true })
|
||||
.catch((e) => log.verbose('logfile', `could not create logs-dir: ${e}`)))
|
||||
}
|
||||
|
||||
// note: this MUST be shorter than the actual argv length, because it
|
||||
// uses the same memory, so node will truncate it if it's too long.
|
||||
@@ -438,7 +440,7 @@ class Npm {
|
||||
output (...msg) {
|
||||
log.clearProgress()
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(...msg)
|
||||
console.log(...msg.map(Display.clean))
|
||||
log.showProgress()
|
||||
}
|
||||
|
||||
@@ -476,7 +478,7 @@ class Npm {
|
||||
outputError (...msg) {
|
||||
log.clearProgress()
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(...msg)
|
||||
console.error(...msg.map(Display.clean))
|
||||
log.showProgress()
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+92
-3
@@ -3,6 +3,44 @@ const npmlog = require('npmlog')
|
||||
const log = require('./log-shim.js')
|
||||
const { explain } = require('./explain-eresolve.js')
|
||||
|
||||
const originalCustomInspect = Symbol('npm.display.original.util.inspect.custom')
|
||||
|
||||
// These are most assuredly not a mistake
|
||||
// https://eslint.org/docs/latest/rules/no-control-regex
|
||||
/* eslint-disable no-control-regex */
|
||||
// \x00 through \x1f, \x7f through \x9f, not including \x09 \x0a \x0b \x0d
|
||||
const hasC01 = /[\x00-\x08\x0c\x0e-\x1f\x7f-\x9f]/
|
||||
// Allows everything up to '[38;5;255m' in 8 bit notation
|
||||
const allowedSGR = /^\[[0-9;]{0,8}m/
|
||||
// '[38;5;255m'.length
|
||||
const sgrMaxLen = 10
|
||||
|
||||
// Strips all ANSI C0 and C1 control characters (except for SGR up to 8 bit)
|
||||
function stripC01 (str) {
|
||||
if (!hasC01.test(str)) {
|
||||
return str
|
||||
}
|
||||
let result = ''
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
const char = str[i]
|
||||
const code = char.charCodeAt(0)
|
||||
if (!hasC01.test(char)) {
|
||||
// Most characters are in this set so continue early if we can
|
||||
result = `${result}${char}`
|
||||
} else if (code === 27 && allowedSGR.test(str.slice(i + 1, i + sgrMaxLen + 1))) {
|
||||
// \x1b with allowed SGR
|
||||
result = `${result}\x1b`
|
||||
} else if (code <= 31) {
|
||||
// escape all other C0 control characters besides \x7f
|
||||
result = `${result}^${String.fromCharCode(code + 64)}`
|
||||
} else {
|
||||
// hasC01 ensures this is now a C1 control character or \x7f
|
||||
result = `${result}^${String.fromCharCode(code - 64)}`
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
class Display {
|
||||
#chalk = null
|
||||
|
||||
@@ -12,6 +50,57 @@ class Display {
|
||||
log.pause()
|
||||
}
|
||||
|
||||
static clean (output) {
|
||||
if (typeof output === 'string') {
|
||||
// Strings are cleaned inline
|
||||
return stripC01(output)
|
||||
}
|
||||
if (!output || typeof output !== 'object') {
|
||||
// Numbers, booleans, null all end up here and don't need cleaning
|
||||
return output
|
||||
}
|
||||
// output && typeof output === 'object'
|
||||
// We can't use hasOwn et al for detecting the original but we can use it
|
||||
// for detecting the properties we set via defineProperty
|
||||
if (
|
||||
output[inspect.custom] &&
|
||||
(!Object.hasOwn(output, originalCustomInspect))
|
||||
) {
|
||||
// Save the old one if we didn't already do it.
|
||||
Object.defineProperty(output, originalCustomInspect, {
|
||||
value: output[inspect.custom],
|
||||
writable: true,
|
||||
})
|
||||
}
|
||||
if (!Object.hasOwn(output, originalCustomInspect)) {
|
||||
// Put a dummy one in for when we run multiple times on the same object
|
||||
Object.defineProperty(output, originalCustomInspect, {
|
||||
value: function () {
|
||||
return this
|
||||
},
|
||||
writable: true,
|
||||
})
|
||||
}
|
||||
// Set the custom inspect to our own function
|
||||
Object.defineProperty(output, inspect.custom, {
|
||||
value: function () {
|
||||
const toClean = this[originalCustomInspect]()
|
||||
// Custom inspect can return things other than objects, check type again
|
||||
if (typeof toClean === 'string') {
|
||||
// Strings are cleaned inline
|
||||
return stripC01(toClean)
|
||||
}
|
||||
if (!toClean || typeof toClean !== 'object') {
|
||||
// Numbers, booleans, null all end up here and don't need cleaning
|
||||
return toClean
|
||||
}
|
||||
return stripC01(inspect(toClean, { customInspect: false }))
|
||||
},
|
||||
writable: true,
|
||||
})
|
||||
return output
|
||||
}
|
||||
|
||||
on () {
|
||||
process.on('log', this.#logHandler)
|
||||
}
|
||||
@@ -103,7 +192,7 @@ class Display {
|
||||
// Explicitly call these on npmlog and not log shim
|
||||
// This is the final place we should call npmlog before removing it.
|
||||
#npmlog (level, ...args) {
|
||||
npmlog[level](...args)
|
||||
npmlog[level](...args.map(Display.clean))
|
||||
}
|
||||
|
||||
// Also (and this is a really inexcusable kludge), we patch the
|
||||
@@ -112,8 +201,8 @@ class Display {
|
||||
// highly abbreviated explanation of what's being overridden.
|
||||
#eresolveWarn (level, heading, message, expl) {
|
||||
if (level === 'warn' &&
|
||||
heading === 'ERESOLVE' &&
|
||||
expl && typeof expl === 'object'
|
||||
heading === 'ERESOLVE' &&
|
||||
expl && typeof expl === 'object'
|
||||
) {
|
||||
this.#npmlog(level, heading, message)
|
||||
this.#npmlog(level, '', explain(expl, this.#chalk, 2))
|
||||
|
||||
Vendored
+2
@@ -6,6 +6,7 @@ const { Minipass } = require('minipass')
|
||||
const fsMiniPass = require('fs-minipass')
|
||||
const fs = require('fs/promises')
|
||||
const log = require('./log-shim')
|
||||
const Display = require('./display')
|
||||
|
||||
const padZero = (n, length) => n.toString().padStart(length.toString().length, '0')
|
||||
const globify = pattern => pattern.split('\\').join('/')
|
||||
@@ -49,6 +50,7 @@ class LogFiles {
|
||||
|
||||
return format(...args)
|
||||
.split(/\r?\n/)
|
||||
.map(Display.clean)
|
||||
.reduce((lines, line) =>
|
||||
lines += prefix + (line ? ' ' : '') + line + os.EOL,
|
||||
''
|
||||
|
||||
+2
-3
@@ -1,5 +1,5 @@
|
||||
const readline = require('readline')
|
||||
const promiseSpawn = require('@npmcli/promise-spawn')
|
||||
const open = require('./open-url.js')
|
||||
|
||||
function print (npm, title, url) {
|
||||
const json = npm.config.get('json')
|
||||
@@ -63,8 +63,7 @@ const promptOpen = async (npm, url, title, prompt, emitter) => {
|
||||
return
|
||||
}
|
||||
|
||||
const command = browser === true ? null : browser
|
||||
await promiseSpawn.open(url, { command })
|
||||
await open(npm, url, 'Browser unavailable. Please open the URL manually')
|
||||
}
|
||||
|
||||
module.exports = promptOpen
|
||||
Vendored
+1
-1
@@ -76,7 +76,7 @@ const reifyOutput = (npm, arb) => {
|
||||
summary.audit = npm.command === 'audit' ? auditReport
|
||||
: auditReport.toJSON().metadata
|
||||
}
|
||||
npm.output(JSON.stringify(summary, 0, 2))
|
||||
npm.output(JSON.stringify(summary, null, 2))
|
||||
} else {
|
||||
packagesChangedMessage(npm, summary)
|
||||
packagesFundingMessage(npm, summary)
|
||||
|
||||
Vendored
+4
-4
@@ -11,10 +11,10 @@ const SPDX_IDENTIFER = 'SPDXRef-DOCUMENT'
|
||||
const NO_ASSERTION = 'NOASSERTION'
|
||||
|
||||
const REL_DESCRIBES = 'DESCRIBES'
|
||||
const REL_PREREQ = 'HAS_PREREQUISITE'
|
||||
const REL_PREREQ = 'PREREQUISITE_FOR'
|
||||
const REL_OPTIONAL = 'OPTIONAL_DEPENDENCY_OF'
|
||||
const REL_DEV = 'DEV_DEPENDENCY_OF'
|
||||
const REL_DEP = 'DEPENDS_ON'
|
||||
const REL_DEP = 'DEPENDENCY_OF'
|
||||
|
||||
const REF_CAT_PACKAGE_MANAGER = 'PACKAGE-MANAGER'
|
||||
const REF_TYPE_PURL = 'purl'
|
||||
@@ -147,8 +147,8 @@ const toSpdxRelationship = (node, edge) => {
|
||||
}
|
||||
|
||||
return {
|
||||
spdxElementId: toSpdxID(node),
|
||||
relatedSpdxElement: toSpdxID(edge.to),
|
||||
spdxElementId: toSpdxID(edge.to),
|
||||
relatedSpdxElement: toSpdxID(node),
|
||||
relationshipType: type,
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -24,6 +24,7 @@ const updateCheck = async (npm, spec, version, current) => {
|
||||
// always prefer latest, even if doing --tag=whatever on the cmd
|
||||
defaultTag: 'latest',
|
||||
...npm.flatOptions,
|
||||
cache: false,
|
||||
}).catch(() => null)
|
||||
|
||||
// if pacote failed, give up
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-ACCESS" "1" "November 2023" "" ""
|
||||
.TH "NPM-ACCESS" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-access\fR - Set access level on published packages
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-ADDUSER" "1" "November 2023" "" ""
|
||||
.TH "NPM-ADDUSER" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-adduser\fR - Add a registry user account
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-AUDIT" "1" "November 2023" "" ""
|
||||
.TH "NPM-AUDIT" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-audit\fR - Run a security audit
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-BUGS" "1" "November 2023" "" ""
|
||||
.TH "NPM-BUGS" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-bugs\fR - Report bugs for a package in a web browser
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-CACHE" "1" "November 2023" "" ""
|
||||
.TH "NPM-CACHE" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-cache\fR - Manipulates packages cache
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-CI" "1" "November 2023" "" ""
|
||||
.TH "NPM-CI" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-ci\fR - Clean install a project
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-COMPLETION" "1" "November 2023" "" ""
|
||||
.TH "NPM-COMPLETION" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-completion\fR - Tab Completion for npm
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-CONFIG" "1" "November 2023" "" ""
|
||||
.TH "NPM-CONFIG" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-config\fR - Manage the npm configuration files
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-DEDUPE" "1" "November 2023" "" ""
|
||||
.TH "NPM-DEDUPE" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-dedupe\fR - Reduce duplication in the package tree
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-DEPRECATE" "1" "November 2023" "" ""
|
||||
.TH "NPM-DEPRECATE" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-deprecate\fR - Deprecate a version of a package
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-DIFF" "1" "November 2023" "" ""
|
||||
.TH "NPM-DIFF" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-diff\fR - The registry diff command
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-DIST-TAG" "1" "November 2023" "" ""
|
||||
.TH "NPM-DIST-TAG" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-dist-tag\fR - Modify package distribution tags
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-DOCS" "1" "November 2023" "" ""
|
||||
.TH "NPM-DOCS" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-docs\fR - Open documentation for a package in a web browser
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-DOCTOR" "1" "November 2023" "" ""
|
||||
.TH "NPM-DOCTOR" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-doctor\fR - Check the health of your npm environment
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-EDIT" "1" "November 2023" "" ""
|
||||
.TH "NPM-EDIT" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-edit\fR - Edit an installed package
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-EXEC" "1" "November 2023" "" ""
|
||||
.TH "NPM-EXEC" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-exec\fR - Run a command from a local or remote npm package
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-EXPLAIN" "1" "November 2023" "" ""
|
||||
.TH "NPM-EXPLAIN" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-explain\fR - Explain installed packages
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-EXPLORE" "1" "November 2023" "" ""
|
||||
.TH "NPM-EXPLORE" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-explore\fR - Browse an installed package
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-FIND-DUPES" "1" "November 2023" "" ""
|
||||
.TH "NPM-FIND-DUPES" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-find-dupes\fR - Find duplication in the package tree
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-FUND" "1" "November 2023" "" ""
|
||||
.TH "NPM-FUND" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-fund\fR - Retrieve funding information
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-HELP-SEARCH" "1" "November 2023" "" ""
|
||||
.TH "NPM-HELP-SEARCH" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-help-search\fR - Search npm help documentation
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-HELP" "1" "November 2023" "" ""
|
||||
.TH "NPM-HELP" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-help\fR - Get help on npm
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-HOOK" "1" "November 2023" "" ""
|
||||
.TH "NPM-HOOK" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-hook\fR - Manage registry hooks
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-INIT" "1" "November 2023" "" ""
|
||||
.TH "NPM-INIT" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-init\fR - Create a package.json file
|
||||
.SS "Synopsis"
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-INSTALL-CI-TEST" "1" "November 2023" "" ""
|
||||
.TH "NPM-INSTALL-CI-TEST" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-install-ci-test\fR - Install a project with a clean slate and run tests
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+11
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-INSTALL-TEST" "1" "November 2023" "" ""
|
||||
.TH "NPM-INSTALL-TEST" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-install-test\fR - Install package(s) and run tests
|
||||
.SS "Synopsis"
|
||||
@@ -257,6 +257,16 @@ Type: null or String
|
||||
|
||||
.P
|
||||
Override OS of native modules to install. Acceptable values are same as \fBos\fR field of package.json, which comes from \fBprocess.platform\fR.
|
||||
.SS "\fBlibc\fR"
|
||||
.RS 0
|
||||
.IP \(bu 4
|
||||
Default: null
|
||||
.IP \(bu 4
|
||||
Type: null or String
|
||||
.RE 0
|
||||
|
||||
.P
|
||||
Override libc of native modules to install. Acceptable values are same as \fBlibc\fR field of package.json
|
||||
.SS "\fBworkspace\fR"
|
||||
.RS 0
|
||||
.IP \(bu 4
|
||||
|
||||
Vendored
+11
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-INSTALL" "1" "November 2023" "" ""
|
||||
.TH "NPM-INSTALL" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-install\fR - Install a package
|
||||
.SS "Synopsis"
|
||||
@@ -619,6 +619,16 @@ Type: null or String
|
||||
|
||||
.P
|
||||
Override OS of native modules to install. Acceptable values are same as \fBos\fR field of package.json, which comes from \fBprocess.platform\fR.
|
||||
.SS "\fBlibc\fR"
|
||||
.RS 0
|
||||
.IP \(bu 4
|
||||
Default: null
|
||||
.IP \(bu 4
|
||||
Type: null or String
|
||||
.RE 0
|
||||
|
||||
.P
|
||||
Override libc of native modules to install. Acceptable values are same as \fBlibc\fR field of package.json
|
||||
.SS "\fBworkspace\fR"
|
||||
.RS 0
|
||||
.IP \(bu 4
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-LINK" "1" "November 2023" "" ""
|
||||
.TH "NPM-LINK" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-link\fR - Symlink a package folder
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-LOGIN" "1" "November 2023" "" ""
|
||||
.TH "NPM-LOGIN" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-login\fR - Login to a registry user account
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-LOGOUT" "1" "November 2023" "" ""
|
||||
.TH "NPM-LOGOUT" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-logout\fR - Log out of the registry
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+2
-2
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-LS" "1" "November 2023" "" ""
|
||||
.TH "NPM-LS" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-ls\fR - List installed packages
|
||||
.SS "Synopsis"
|
||||
@@ -20,7 +20,7 @@ Positional arguments are \fBname@version-range\fR identifiers, which will limit
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
npm@10.2.4 /path/to/npm
|
||||
npm@10.3.0 /path/to/npm
|
||||
└─┬ init-package-json@0.0.4
|
||||
└── promzard@0.1.5
|
||||
.fi
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-ORG" "1" "November 2023" "" ""
|
||||
.TH "NPM-ORG" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-org\fR - Manage orgs
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-OUTDATED" "1" "November 2023" "" ""
|
||||
.TH "NPM-OUTDATED" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-outdated\fR - Check for outdated packages
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-OWNER" "1" "November 2023" "" ""
|
||||
.TH "NPM-OWNER" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-owner\fR - Manage package owners
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-PACK" "1" "November 2023" "" ""
|
||||
.TH "NPM-PACK" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-pack\fR - Create a tarball from a package
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-PING" "1" "November 2023" "" ""
|
||||
.TH "NPM-PING" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-ping\fR - Ping npm registry
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-PKG" "1" "November 2023" "" ""
|
||||
.TH "NPM-PKG" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-pkg\fR - Manages your package.json
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-PREFIX" "1" "November 2023" "" ""
|
||||
.TH "NPM-PREFIX" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-prefix\fR - Display prefix
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-PROFILE" "1" "November 2023" "" ""
|
||||
.TH "NPM-PROFILE" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-profile\fR - Change settings on your registry profile
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-PRUNE" "1" "November 2023" "" ""
|
||||
.TH "NPM-PRUNE" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-prune\fR - Remove extraneous packages
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+2
-2
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-PUBLISH" "1" "November 2023" "" ""
|
||||
.TH "NPM-PUBLISH" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-publish\fR - Publish a package
|
||||
.SS "Synopsis"
|
||||
@@ -14,7 +14,7 @@ Publishes a package to the registry so that it can be installed by name.
|
||||
.P
|
||||
By default npm will publish to the public registry. This can be overridden by specifying a different default registry or using a npm help scope in the name, combined with a scope-configured registry (see \fB\fBpackage.json\fR\fR \fI\(la/configuring-npm/package-json\(ra\fR).
|
||||
.P
|
||||
A \fBpackage\fR is interpreted the same way as other commands (like \fBnpm install\fR and can be:
|
||||
A \fBpackage\fR is interpreted the same way as other commands (like \fBnpm install\fR) and can be:
|
||||
.RS 0
|
||||
.IP \(bu 4
|
||||
a) a folder containing a program described by a \fB\fBpackage.json\fR\fR \fI\(la/configuring-npm/package-json\(ra\fR file
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-QUERY" "1" "November 2023" "" ""
|
||||
.TH "NPM-QUERY" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-query\fR - Dependency selector query
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-REBUILD" "1" "November 2023" "" ""
|
||||
.TH "NPM-REBUILD" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-rebuild\fR - Rebuild a package
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-REPO" "1" "November 2023" "" ""
|
||||
.TH "NPM-REPO" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-repo\fR - Open package repository page in the browser
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-RESTART" "1" "November 2023" "" ""
|
||||
.TH "NPM-RESTART" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-restart\fR - Restart a package
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-ROOT" "1" "November 2023" "" ""
|
||||
.TH "NPM-ROOT" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-root\fR - Display npm root
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-RUN-SCRIPT" "1" "November 2023" "" ""
|
||||
.TH "NPM-RUN-SCRIPT" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-run-script\fR - Run arbitrary package scripts
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+2
-2
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-SBOM" "1" "November 2023" "" ""
|
||||
.TH "NPM-SBOM" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-sbom\fR - Generate a Software Bill of Materials (SBOM)
|
||||
.SS "Synopsis"
|
||||
@@ -256,7 +256,7 @@ Type: "library", "application", or "framework"
|
||||
.RE 0
|
||||
|
||||
.P
|
||||
The type of package described by the generated SBOM. For SPDX, this is the value for the \fBprimaryPackagePurpose\fR fieled. For CycloneDX, this is the value for the \fBtype\fR field.
|
||||
The type of package described by the generated SBOM. For SPDX, this is the value for the \fBprimaryPackagePurpose\fR field. For CycloneDX, this is the value for the \fBtype\fR field.
|
||||
.SS "\fBworkspace\fR"
|
||||
.RS 0
|
||||
.IP \(bu 4
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-SEARCH" "1" "November 2023" "" ""
|
||||
.TH "NPM-SEARCH" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-search\fR - Search for packages
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-SHRINKWRAP" "1" "November 2023" "" ""
|
||||
.TH "NPM-SHRINKWRAP" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-shrinkwrap\fR - Lock down dependency versions for publication
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-STAR" "1" "November 2023" "" ""
|
||||
.TH "NPM-STAR" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-star\fR - Mark your favorite packages
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-STARS" "1" "November 2023" "" ""
|
||||
.TH "NPM-STARS" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-stars\fR - View packages marked as favorites
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-START" "1" "November 2023" "" ""
|
||||
.TH "NPM-START" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-start\fR - Start a package
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-STOP" "1" "November 2023" "" ""
|
||||
.TH "NPM-STOP" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-stop\fR - Stop a package
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-TEAM" "1" "November 2023" "" ""
|
||||
.TH "NPM-TEAM" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-team\fR - Manage organization teams and team memberships
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-TEST" "1" "November 2023" "" ""
|
||||
.TH "NPM-TEST" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-test\fR - Test a package
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-TOKEN" "1" "November 2023" "" ""
|
||||
.TH "NPM-TOKEN" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-token\fR - Manage your authentication tokens
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-UNINSTALL" "1" "November 2023" "" ""
|
||||
.TH "NPM-UNINSTALL" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-uninstall\fR - Remove a package
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+4
-2
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-UNPUBLISH" "1" "November 2023" "" ""
|
||||
.TH "NPM-UNPUBLISH" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-unpublish\fR - Remove a package from the registry
|
||||
.SS "Synopsis"
|
||||
@@ -19,7 +19,9 @@ This removes a package version from the registry, deleting its entry and removin
|
||||
.P
|
||||
The npm registry will return an error if you are not npm help "logged in".
|
||||
.P
|
||||
If you do not specify a version or if you remove all of a package's versions then the registry will remove the root package entry entirely.
|
||||
If you do not specify a package name at all, the name and version to be unpublished will be pulled from the project in the current directory.
|
||||
.P
|
||||
If you specify a package name but do not specify a version or if you remove all of a package's versions then the registry will remove the root package entry entirely.
|
||||
.P
|
||||
Even if you unpublish a package version, that specific name and version combination can never be reused. In order to publish the package again, you must use a new version number. If you unpublish the entire package, you may not publish any new versions of that package until 24 hours have passed.
|
||||
.SS "Configuration"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-UNSTAR" "1" "November 2023" "" ""
|
||||
.TH "NPM-UNSTAR" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-unstar\fR - Remove an item from your favorite packages
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-UPDATE" "1" "November 2023" "" ""
|
||||
.TH "NPM-UPDATE" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-update\fR - Update packages
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-VERSION" "1" "November 2023" "" ""
|
||||
.TH "NPM-VERSION" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-version\fR - Bump a package version
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-VIEW" "1" "November 2023" "" ""
|
||||
.TH "NPM-VIEW" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-view\fR - View registry info
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH "NPM-WHOAMI" "1" "November 2023" "" ""
|
||||
.TH "NPM-WHOAMI" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm-whoami\fR - Display npm username
|
||||
.SS "Synopsis"
|
||||
|
||||
Vendored
+2
-2
@@ -1,4 +1,4 @@
|
||||
.TH "NPM" "1" "November 2023" "" ""
|
||||
.TH "NPM" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpm\fR - javascript package manager
|
||||
.SS "Synopsis"
|
||||
@@ -12,7 +12,7 @@ npm
|
||||
Note: This command is unaware of workspaces.
|
||||
.SS "Version"
|
||||
.P
|
||||
10.2.4
|
||||
10.3.0
|
||||
.SS "Description"
|
||||
.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 conflicts intelligently.
|
||||
|
||||
Vendored
+2
-2
@@ -1,4 +1,4 @@
|
||||
.TH "NPX" "1" "November 2023" "" ""
|
||||
.TH "NPX" "1" "January 2024" "" ""
|
||||
.SH "NAME"
|
||||
\fBnpx\fR - Run a command from a local or remote npm package
|
||||
.SS "Synopsis"
|
||||
@@ -128,7 +128,7 @@ The \fB--ignore-existing\fR option is removed. Locally installed bins are always
|
||||
.IP \(bu 4
|
||||
The \fB--npm\fR option is removed. \fBnpx\fR will always use the \fBnpm\fR it ships with.
|
||||
.IP \(bu 4
|
||||
The \fB--node-arg\fR and \fB-n\fR options are removed.
|
||||
The \fB--node-arg\fR and \fB-n\fR options have been removed. Use \fB\fBNODE_OPTIONS\fR\fR \fI\(lahttps://nodejs.org/api/cli.html#node_optionsoptions\(ra\fR instead: e.g., \fBNODE_OPTIONS="--trace-warnings --trace-exit" npx foo --random=true\fR
|
||||
.IP \(bu 4
|
||||
The \fB--always-spawn\fR option is redundant, and thus removed.
|
||||
.IP \(bu 4
|
||||
|
||||
Loaded 100 of 290 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user