summaryrefslogtreecommitdiff
path: root/deps/npm/lib/exec.js
diff options
context:
space:
mode:
authorRuy Adorno <ruyadorno@hotmail.com>2021-02-02 12:59:10 -0500
committerRich Trott <rtrott@gmail.com>2021-02-02 21:13:40 -0800
commit861a396a4a6f745d206e5025cfdc2cdaba2e1aa2 (patch)
tree7fca83254ce888331e488d25966e52d54279857b /deps/npm/lib/exec.js
parenta8d7de1efb1fc633d35277d398f57abc368cdede (diff)
downloadnode-new-861a396a4a6f745d206e5025cfdc2cdaba2e1aa2.tar.gz
deps: upgrade npm to 7.5.2
PR-URL: https://github.com/nodejs/node/pull/37191 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Diffstat (limited to 'deps/npm/lib/exec.js')
-rw-r--r--deps/npm/lib/exec.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/deps/npm/lib/exec.js b/deps/npm/lib/exec.js
index d36dd87cfb..e90ec0866e 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))