From e63b380f761f4cfd7285e8553d3a3a84b5ff63e7 Mon Sep 17 00:00:00 2001
From: Ruy Adorno npm explain
the results to only the paths to the packages named. Note that nested
packages will also show the paths to the specified packages. For
example, running npm ls promzard in npm’s source tree will show:
npm@7.5.1 /path/to/npm
+npm@7.5.2 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html
index 727120c1b74..fe014b1c347 100644
--- a/deps/npm/docs/output/commands/npm.html
+++ b/deps/npm/docs/output/commands/npm.html
@@ -148,7 +148,7 @@ npm command-line interface
npm <command> [args]
Version
-7.5.1
+7.5.2
Description
npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
diff --git a/deps/npm/lib/exec.js b/deps/npm/lib/exec.js
index d36dd87cfb9..e90ec0866e4 100644
--- a/deps/npm/lib/exec.js
+++ b/deps/npm/lib/exec.js
@@ -169,8 +169,12 @@ const exec = async args => {
return await readPackageJson(pj)
} catch (er) {}
}
+ // Force preferOnline to true so we are making sure to pull in the latest
+ // This is especially useful if the user didn't give us a version, and
+ // they expect to be running @latest
return await pacote.manifest(p, {
...npm.flatOptions,
+ preferOnline: true,
})
}))
@@ -193,9 +197,13 @@ const exec = async args => {
const arb = new Arborist({ ...npm.flatOptions, path: installDir })
const tree = await arb.loadActual()
- // any that don't match the manifest we have, install them
- // add installDir/node_modules/.bin to pathArr
- const add = manis.filter(mani => manifestMissing(tree, mani))
+ // at this point, we have to ensure that we get the exact same
+ // version, because it's something that has only ever been installed
+ // by npm exec in the cache install directory
+ const add = manis.filter(mani => manifestMissing(tree, {
+ ...mani,
+ _from: `${mani.name}@${mani.version}`,
+ }))
.map(mani => mani._from)
.sort((a, b) => a.localeCompare(b))
diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js
index 7a15a29b2fe..40aa9bbd9b5 100644
--- a/deps/npm/lib/npm.js
+++ b/deps/npm/lib/npm.js
@@ -173,8 +173,8 @@ const npm = module.exports = new class extends EventEmitter {
if (node && node.toUpperCase() !== process.execPath.toUpperCase()) {
log.verbose('node symlink', node)
process.execPath = node
+ this.config.execPath = node
}
- this.config.execPath = node
await this.config.load()
this.argv = this.config.parsedArgv.remain
diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1
index 450f21d7b75..8c7dc273236 100644
--- a/deps/npm/man/man1/npm-ls.1
+++ b/deps/npm/man/man1/npm-ls.1
@@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show:
.P
.RS 2
.nf
-npm@7\.5\.1 /path/to/npm
+npm@7\.5\.2 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1
index fc76aef29eb..206cc3124f7 100644
--- a/deps/npm/man/man1/npm.1
+++ b/deps/npm/man/man1/npm.1
@@ -10,7 +10,7 @@ npm [args]
.RE
.SS Version
.P
-7\.5\.1
+7\.5\.2
.SS Description
.P
npm is the package manager for the Node JavaScript platform\. It puts
diff --git a/deps/npm/node_modules/@npmcli/config/lib/set-envs.js b/deps/npm/node_modules/@npmcli/config/lib/set-envs.js
index 08933379616..36d37145466 100644
--- a/deps/npm/node_modules/@npmcli/config/lib/set-envs.js
+++ b/deps/npm/node_modules/@npmcli/config/lib/set-envs.js
@@ -53,13 +53,7 @@ const setEnvs = (config) => {
list: [cliConf, envConf],
} = config
- const { DESTDIR } = env
- if (platform !== 'win32' && DESTDIR && globalPrefix.indexOf(DESTDIR) === 0)
- env.PREFIX = globalPrefix.substr(DESTDIR.length)
- else
- env.PREFIX = globalPrefix
-
- env.INIT_CWD = env.INIT_CWD || process.cwd()
+ env.INIT_CWD = process.cwd()
// if the key is the default value,
// if the environ is NOT the default value,
diff --git a/deps/npm/node_modules/@npmcli/config/package.json b/deps/npm/node_modules/@npmcli/config/package.json
index a7050c73a03..644544a49d8 100644
--- a/deps/npm/node_modules/@npmcli/config/package.json
+++ b/deps/npm/node_modules/@npmcli/config/package.json
@@ -1,6 +1,6 @@
{
"name": "@npmcli/config",
- "version": "1.2.8",
+ "version": "1.2.9",
"files": [
"lib"
],
diff --git a/deps/npm/package.json b/deps/npm/package.json
index 57b7f48964b..2eecfdbfc04 100644
--- a/deps/npm/package.json
+++ b/deps/npm/package.json
@@ -1,5 +1,5 @@
{
- "version": "7.5.1",
+ "version": "7.5.2",
"name": "npm",
"description": "a package manager for JavaScript",
"keywords": [
@@ -44,7 +44,7 @@
"dependencies": {
"@npmcli/arborist": "^2.1.1",
"@npmcli/ci-detect": "^1.2.0",
- "@npmcli/config": "^1.2.8",
+ "@npmcli/config": "^1.2.9",
"@npmcli/run-script": "^1.8.1",
"abbrev": "~1.1.1",
"ansicolors": "~0.3.2",