Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: upgrade npm to 7.23.0 #40055

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion deps/npm/docs/content/commands/npm-deprecate.md
Expand Up @@ -76,4 +76,4 @@ password, npm will prompt on the command line for one.
* [npm publish](/commands/npm-publish)
* [npm registry](/using-npm/registry)
* [npm owner](/commands/npm-owner)
* [npm owner](/commands/npm-adduser)
* [npm adduser](/commands/npm-adduser)
10 changes: 10 additions & 0 deletions deps/npm/docs/content/using-npm/workspaces.md
Expand Up @@ -176,6 +176,16 @@ npm run test --workspaces

Will run the `test` script in both `./packages/a` and `./packages/b`.

### Ignoring missing scripts

It is not required for all of the workspaces to implement scripts run with the `npm run` command.

By running the command with the `--if-present` flag, npm will ignore workspaces missing target script.

```
npm run test --workspaces --if-present
```

### See also

* [npm install](/commands/npm-install)
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-deprecate.html
Expand Up @@ -194,7 +194,7 @@ <h3 id="see-also">See Also</h3>
<li><a href="../commands/npm-publish.html">npm publish</a></li>
<li><a href="../using-npm/registry.html">npm registry</a></li>
<li><a href="../commands/npm-owner.html">npm owner</a></li>
<li><a href="../commands/npm-adduser.html">npm owner</a></li>
<li><a href="../commands/npm-adduser.html">npm adduser</a></li>
</ul>
</div>

Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Expand Up @@ -159,7 +159,7 @@ <h3 id="description">Description</h3>
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@7.21.1 /path/to/npm
<pre lang="bash"><code>npm@7.23.0 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm.html
Expand Up @@ -148,7 +148,7 @@ <h2 id="table-of-contents">Table of contents</h2>
<pre lang="bash"><code>npm &lt;command&gt; [args]
</code></pre>
<h3 id="version">Version</h3>
<p>7.21.1</p>
<p>7.23.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
Expand Down
7 changes: 6 additions & 1 deletion deps/npm/docs/output/using-npm/workspaces.html
Expand Up @@ -141,7 +141,7 @@ <h1 id="workspaces">workspaces</h1>

<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><li><a href="#defining-workspaces">Defining workspaces</a></li><li><a href="#getting-started-with-workspaces">Getting started with workspaces</a></li><li><a href="#adding-dependencies-to-a-workspace">Adding dependencies to a workspace</a></li><li><a href="#using-workspaces">Using workspaces</a></li><li><a href="#running-commands-in-the-context-of-workspaces">Running commands in the context of workspaces</a></li><li><a href="#see-also">See also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#description">Description</a></li><li><a href="#defining-workspaces">Defining workspaces</a></li><li><a href="#getting-started-with-workspaces">Getting started with workspaces</a></li><li><a href="#adding-dependencies-to-a-workspace">Adding dependencies to a workspace</a></li><li><a href="#using-workspaces">Using workspaces</a></li><li><a href="#running-commands-in-the-context-of-workspaces">Running commands in the context of workspaces</a></li><li><a href="#ignoring-missing-scripts">Ignoring missing scripts</a></li><li><a href="#see-also">See also</a></li></ul></div>
</section>

<div id="_content"><h3 id="description">Description</h3>
Expand Down Expand Up @@ -264,6 +264,11 @@ <h3 id="running-commands-in-the-context-of-workspaces">Running commands in the c
<pre><code>npm run test --workspaces
</code></pre>
<p>Will run the <code>test</code> script in both <code>./packages/a</code> and <code>./packages/b</code>.</p>
<h3 id="ignoring-missing-scripts">Ignoring missing scripts</h3>
<p>It is not required for all of the workspaces to implement scripts run with the <code>npm run</code> command.</p>
<p>By running the command with the <code>--if-present</code> flag, npm will ignore workspaces missing target script.</p>
<pre><code>npm run test --workspaces --if-present
</code></pre>
<h3 id="see-also">See also</h3>
<ul>
<li><a href="../commands/npm-install.html">npm install</a></li>
Expand Down
22 changes: 20 additions & 2 deletions deps/npm/lib/install.js
Expand Up @@ -8,6 +8,8 @@ const log = require('npmlog')
const { resolve, join } = require('path')
const Arborist = require('@npmcli/arborist')
const runScript = require('@npmcli/run-script')
const pacote = require('pacote')
const checks = require('npm-install-checks')

const ArboristWorkspaceCmd = require('./workspaces/arborist-cmd.js')
class Install extends ArboristWorkspaceCmd {
Expand Down Expand Up @@ -126,6 +128,23 @@ class Install extends ArboristWorkspaceCmd {
const ignoreScripts = this.npm.config.get('ignore-scripts')
const isGlobalInstall = this.npm.config.get('global')
const where = isGlobalInstall ? globalTop : this.npm.prefix
const forced = this.npm.config.get('force')
const isDev = this.npm.config.get('dev')
const scriptShell = this.npm.config.get('script-shell') || undefined

// be very strict about engines when trying to update npm itself
const npmInstall = args.find(arg => arg.startsWith('npm@') || arg === 'npm')
if (isGlobalInstall && npmInstall) {
const npmManifest = await pacote.manifest(npmInstall)
try {
checks.checkEngine(npmManifest, npmManifest.version, process.version)
} catch (e) {
if (forced)
this.npm.log.warn('install', `Forcing global npm install with incompatible version ${npmManifest.version} into node ${process.version}`)
else
throw e
}
}

// don't try to install the prefix into itself
args = args.filter(a => resolve(a) !== this.npm.prefix)
Expand All @@ -135,7 +154,7 @@ class Install extends ArboristWorkspaceCmd {
args = ['.']

// TODO: Add warnings for other deprecated flags? or remove this one?
if (this.npm.config.get('dev'))
if (isDev)
log.warn('install', 'Usage of the `--dev` option is deprecated. Use `--include=dev` instead.')

const opts = {
Expand All @@ -150,7 +169,6 @@ class Install extends ArboristWorkspaceCmd {
await arb.reify(opts)

if (!args.length && !isGlobalInstall && !ignoreScripts) {
const scriptShell = this.npm.config.get('script-shell') || undefined
const scripts = [
'preinstall',
'install',
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/lib/utils/error-message.js
Expand Up @@ -181,7 +181,7 @@ module.exports = (er, npm) => {
const pkg = er.pkgid.replace(/(?!^)@.*$/, '')

detail.push(['404', ''])
detail.push(['404', '', "'" + er.pkgid + "' is not in the npm registry."])
detail.push(['404', '', `'${replaceInfo(er.pkgid)}' is not in this registry.`])

const valResult = nameValidator(pkg)

Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-access.1
@@ -1,4 +1,4 @@
.TH "NPM\-ACCESS" "1" "August 2021" "" ""
.TH "NPM\-ACCESS" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-access\fR \- Set access level on published packages
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-adduser.1
@@ -1,4 +1,4 @@
.TH "NPM\-ADDUSER" "1" "August 2021" "" ""
.TH "NPM\-ADDUSER" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-adduser\fR \- Add a registry user account
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-audit.1
@@ -1,4 +1,4 @@
.TH "NPM\-AUDIT" "1" "August 2021" "" ""
.TH "NPM\-AUDIT" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-audit\fR \- Run a security audit
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-bin.1
@@ -1,4 +1,4 @@
.TH "NPM\-BIN" "1" "August 2021" "" ""
.TH "NPM\-BIN" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-bin\fR \- Display npm bin folder
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-bugs.1
@@ -1,4 +1,4 @@
.TH "NPM\-BUGS" "1" "August 2021" "" ""
.TH "NPM\-BUGS" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-bugs\fR \- Report bugs for a package in a web browser
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-cache.1
@@ -1,4 +1,4 @@
.TH "NPM\-CACHE" "1" "August 2021" "" ""
.TH "NPM\-CACHE" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-cache\fR \- Manipulates packages cache
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-ci.1
@@ -1,4 +1,4 @@
.TH "NPM\-CI" "1" "August 2021" "" ""
.TH "NPM\-CI" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-ci\fR \- Install a project with a clean slate
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-completion.1
@@ -1,4 +1,4 @@
.TH "NPM\-COMPLETION" "1" "August 2021" "" ""
.TH "NPM\-COMPLETION" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-completion\fR \- Tab Completion for npm
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-config.1
@@ -1,4 +1,4 @@
.TH "NPM\-CONFIG" "1" "August 2021" "" ""
.TH "NPM\-CONFIG" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-config\fR \- Manage the npm configuration files
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-dedupe.1
@@ -1,4 +1,4 @@
.TH "NPM\-DEDUPE" "1" "August 2021" "" ""
.TH "NPM\-DEDUPE" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-dedupe\fR \- Reduce duplication in the package tree
.SS Synopsis
Expand Down
4 changes: 2 additions & 2 deletions deps/npm/man/man1/npm-deprecate.1
@@ -1,4 +1,4 @@
.TH "NPM\-DEPRECATE" "1" "August 2021" "" ""
.TH "NPM\-DEPRECATE" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-deprecate\fR \- Deprecate a version of a package
.SS Synopsis
Expand Down Expand Up @@ -86,6 +86,6 @@ npm help registry
.IP \(bu 2
npm help owner
.IP \(bu 2
npm help owner
npm help adduser

.RE
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-diff.1
@@ -1,4 +1,4 @@
.TH "NPM\-DIFF" "1" "August 2021" "" ""
.TH "NPM\-DIFF" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-diff\fR \- The registry diff command
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-dist-tag.1
@@ -1,4 +1,4 @@
.TH "NPM\-DIST\-TAG" "1" "August 2021" "" ""
.TH "NPM\-DIST\-TAG" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-dist-tag\fR \- Modify package distribution tags
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-docs.1
@@ -1,4 +1,4 @@
.TH "NPM\-DOCS" "1" "August 2021" "" ""
.TH "NPM\-DOCS" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-docs\fR \- Open documentation for a package in a web browser
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-doctor.1
@@ -1,4 +1,4 @@
.TH "NPM\-DOCTOR" "1" "August 2021" "" ""
.TH "NPM\-DOCTOR" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-doctor\fR \- Check your npm environment
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-edit.1
@@ -1,4 +1,4 @@
.TH "NPM\-EDIT" "1" "August 2021" "" ""
.TH "NPM\-EDIT" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-edit\fR \- Edit an installed package
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-exec.1
@@ -1,4 +1,4 @@
.TH "NPM\-EXEC" "1" "August 2021" "" ""
.TH "NPM\-EXEC" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-exec\fR \- Run a command from a local or remote npm package
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-explain.1
@@ -1,4 +1,4 @@
.TH "NPM\-EXPLAIN" "1" "August 2021" "" ""
.TH "NPM\-EXPLAIN" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-explain\fR \- Explain installed packages
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-explore.1
@@ -1,4 +1,4 @@
.TH "NPM\-EXPLORE" "1" "August 2021" "" ""
.TH "NPM\-EXPLORE" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-explore\fR \- Browse an installed package
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-find-dupes.1
@@ -1,4 +1,4 @@
.TH "NPM\-FIND\-DUPES" "1" "August 2021" "" ""
.TH "NPM\-FIND\-DUPES" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-find-dupes\fR \- Find duplication in the package tree
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-fund.1
@@ -1,4 +1,4 @@
.TH "NPM\-FUND" "1" "August 2021" "" ""
.TH "NPM\-FUND" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-fund\fR \- Retrieve funding information
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-help-search.1
@@ -1,4 +1,4 @@
.TH "NPM\-HELP\-SEARCH" "1" "August 2021" "" ""
.TH "NPM\-HELP\-SEARCH" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-help-search\fR \- Search npm help documentation
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-help.1
@@ -1,4 +1,4 @@
.TH "NPM\-HELP" "1" "August 2021" "" ""
.TH "NPM\-HELP" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-help\fR \- Get help on npm
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-hook.1
@@ -1,4 +1,4 @@
.TH "NPM\-HOOK" "1" "August 2021" "" ""
.TH "NPM\-HOOK" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-hook\fR \- Manage registry hooks
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-init.1
@@ -1,4 +1,4 @@
.TH "NPM\-INIT" "1" "August 2021" "" ""
.TH "NPM\-INIT" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-init\fR \- Create a package\.json file
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-install-ci-test.1
@@ -1,4 +1,4 @@
.TH "NPM\-INSTALL\-CI\-TEST" "1" "August 2021" "" ""
.TH "NPM\-INSTALL\-CI\-TEST" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-install-ci-test\fR \- Install a project with a clean slate and run tests
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-install-test.1
@@ -1,4 +1,4 @@
.TH "NPM\-INSTALL\-TEST" "1" "August 2021" "" ""
.TH "NPM\-INSTALL\-TEST" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-install-test\fR \- Install package(s) and run tests
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-install.1
@@ -1,4 +1,4 @@
.TH "NPM\-INSTALL" "1" "August 2021" "" ""
.TH "NPM\-INSTALL" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-install\fR \- Install a package
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-link.1
@@ -1,4 +1,4 @@
.TH "NPM\-LINK" "1" "August 2021" "" ""
.TH "NPM\-LINK" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-link\fR \- Symlink a package folder
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-logout.1
@@ -1,4 +1,4 @@
.TH "NPM\-LOGOUT" "1" "August 2021" "" ""
.TH "NPM\-LOGOUT" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-logout\fR \- Log out of the registry
.SS Synopsis
Expand Down
4 changes: 2 additions & 2 deletions deps/npm/man/man1/npm-ls.1
@@ -1,4 +1,4 @@
.TH "NPM\-LS" "1" "August 2021" "" ""
.TH "NPM\-LS" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-ls\fR \- List installed packages
.SS Synopsis
Expand Down Expand Up @@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show:
.P
.RS 2
.nf
npm@7\.21\.1 /path/to/npm
npm@7\.23\.0 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-org.1
@@ -1,4 +1,4 @@
.TH "NPM\-ORG" "1" "August 2021" "" ""
.TH "NPM\-ORG" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-org\fR \- Manage orgs
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-outdated.1
@@ -1,4 +1,4 @@
.TH "NPM\-OUTDATED" "1" "August 2021" "" ""
.TH "NPM\-OUTDATED" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-outdated\fR \- Check for outdated packages
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-owner.1
@@ -1,4 +1,4 @@
.TH "NPM\-OWNER" "1" "August 2021" "" ""
.TH "NPM\-OWNER" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-owner\fR \- Manage package owners
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-pack.1
@@ -1,4 +1,4 @@
.TH "NPM\-PACK" "1" "August 2021" "" ""
.TH "NPM\-PACK" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-pack\fR \- Create a tarball from a package
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-ping.1
@@ -1,4 +1,4 @@
.TH "NPM\-PING" "1" "August 2021" "" ""
.TH "NPM\-PING" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-ping\fR \- Ping npm registry
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-pkg.1
@@ -1,4 +1,4 @@
.TH "NPM\-PKG" "1" "August 2021" "" ""
.TH "NPM\-PKG" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-pkg\fR \- Manages your package\.json
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-prefix.1
@@ -1,4 +1,4 @@
.TH "NPM\-PREFIX" "1" "August 2021" "" ""
.TH "NPM\-PREFIX" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-prefix\fR \- Display prefix
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-profile.1
@@ -1,4 +1,4 @@
.TH "NPM\-PROFILE" "1" "August 2021" "" ""
.TH "NPM\-PROFILE" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-profile\fR \- Change settings on your registry profile
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-prune.1
@@ -1,4 +1,4 @@
.TH "NPM\-PRUNE" "1" "August 2021" "" ""
.TH "NPM\-PRUNE" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-prune\fR \- Remove extraneous packages
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-publish.1
@@ -1,4 +1,4 @@
.TH "NPM\-PUBLISH" "1" "August 2021" "" ""
.TH "NPM\-PUBLISH" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-publish\fR \- Publish a package
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-rebuild.1
@@ -1,4 +1,4 @@
.TH "NPM\-REBUILD" "1" "August 2021" "" ""
.TH "NPM\-REBUILD" "1" "September 2021" "" ""
.SH "NAME"
\fBnpm-rebuild\fR \- Rebuild a package
.SS Synopsis
Expand Down