Skip to content

Commit 052b0ba

Browse files
npm-cli-botrichardlau
authored andcommittedApr 26, 2024
deps: upgrade npm to 10.5.1
PR-URL: #52351 Reviewed-By: Luke Karrys <luke@lukekarrys.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 209823d commit 052b0ba

File tree

219 files changed

+1600
-1081
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

219 files changed

+1600
-1081
lines changed
 

‎deps/npm/bin/npm

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ if [ $? -ne 0 ]; then
4141
fi
4242
no_node_dir
4343
fi
44+
NPM_PREFIX_JS="$CLI_BASEDIR/node_modules/npm/bin/npm-prefix.js"
4445
NPM_CLI_JS="$CLI_BASEDIR/node_modules/npm/bin/npm-cli.js"
45-
NPM_PREFIX=`"$NODE_EXE" "$NPM_CLI_JS" prefix -g`
46+
NPM_PREFIX=`"$NODE_EXE" "$NPM_PREFIX_JS"`
4647
if [ $? -ne 0 ]; then
4748
no_node_dir
4849
fi

‎deps/npm/bin/npm-prefix.js

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env node
2+
// This is a single-use bin to help windows discover the proper prefix for npm
3+
// without having to load all of npm first
4+
// It does not accept argv params
5+
6+
const path = require('path')
7+
const Config = require('@npmcli/config')
8+
const { definitions, flatten, shorthands } = require('@npmcli/config/lib/definitions')
9+
const config = new Config({
10+
npmPath: path.dirname(__dirname),
11+
// argv is explicitly not looked at since prefix is not something that can be changed via argv
12+
argv: [],
13+
definitions,
14+
flatten,
15+
shorthands,
16+
excludeNpmCwd: false,
17+
})
18+
19+
async function main () {
20+
try {
21+
await config.load()
22+
// eslint-disable-next-line no-console
23+
console.log(config.globalPrefix)
24+
} catch (err) {
25+
// eslint-disable-next-line no-console
26+
console.error(err)
27+
process.exit(1)
28+
}
29+
}
30+
main()

0 commit comments

Comments
 (0)
Please sign in to comment.