Skip to content

Commit a221db7

Browse files
committed
deps: npm-install-checks@7.1.1
1 parent fbad17a commit a221db7

File tree

4 files changed

+40
-12
lines changed

4 files changed

+40
-12
lines changed

node_modules/npm-install-checks/lib/current-env.js

+32-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const process = require('node:process')
22
const nodeOs = require('node:os')
3+
const fs = require('node:fs')
34

45
function isMusl (file) {
56
return file.includes('libc.musl-') || file.includes('ld-musl-')
@@ -13,12 +14,23 @@ function cpu () {
1314
return process.arch
1415
}
1516

16-
function libc (osName) {
17-
// this is to make it faster on non linux machines
18-
if (osName !== 'linux') {
17+
const LDD_PATH = '/usr/bin/ldd'
18+
function getFamilyFromFilesystem () {
19+
try {
20+
const content = fs.readFileSync(LDD_PATH, 'utf-8')
21+
if (content.includes('musl')) {
22+
return 'musl'
23+
}
24+
if (content.includes('GNU C Library')) {
25+
return 'glibc'
26+
}
27+
return null
28+
} catch {
1929
return undefined
2030
}
21-
let family
31+
}
32+
33+
function getFamilyFromReport () {
2234
const originalExclude = process.report.excludeNetwork
2335
process.report.excludeNetwork = true
2436
const report = process.report.getReport()
@@ -27,6 +39,22 @@ function libc (osName) {
2739
family = 'glibc'
2840
} else if (Array.isArray(report.sharedObjects) && report.sharedObjects.some(isMusl)) {
2941
family = 'musl'
42+
} else {
43+
family = null
44+
}
45+
return family
46+
}
47+
48+
let family
49+
function libc (osName) {
50+
if (osName !== 'linux') {
51+
return undefined
52+
}
53+
if (family === undefined) {
54+
family = getFamilyFromFilesystem()
55+
if (family === undefined) {
56+
family = getFamilyFromReport()
57+
}
3058
}
3159
return family
3260
}

node_modules/npm-install-checks/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "npm-install-checks",
3-
"version": "7.1.0",
3+
"version": "7.1.1",
44
"description": "Check the engines and platform fields in package.json",
55
"main": "lib/index.js",
66
"dependencies": {
77
"semver": "^7.1.1"
88
},
99
"devDependencies": {
1010
"@npmcli/eslint-config": "^5.0.0",
11-
"@npmcli/template-oss": "4.23.3",
11+
"@npmcli/template-oss": "4.23.4",
1212
"tap": "^16.0.1"
1313
},
1414
"scripts": {
@@ -40,7 +40,7 @@
4040
"author": "GitHub Inc.",
4141
"templateOSS": {
4242
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
43-
"version": "4.23.3",
43+
"version": "4.23.4",
4444
"publish": "true"
4545
},
4646
"tap": {

package-lock.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
"nopt": "^8.0.0",
132132
"normalize-package-data": "^7.0.0",
133133
"npm-audit-report": "^6.0.0",
134-
"npm-install-checks": "^7.1.0",
134+
"npm-install-checks": "^7.1.1",
135135
"npm-package-arg": "^12.0.0",
136136
"npm-pick-manifest": "^10.0.0",
137137
"npm-profile": "^11.0.1",
@@ -10707,9 +10707,9 @@
1070710707
}
1070810708
},
1070910709
"node_modules/npm-install-checks": {
10710-
"version": "7.1.0",
10711-
"resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-7.1.0.tgz",
10712-
"integrity": "sha512-bkTildVlofeMX7wiOaWk3PlW7YcBXAuEc7TWpOxwUgalG5ZvgT/ms+6OX9zt7iGLv4+VhKbRZhpOfgQJzk1YAw==",
10710+
"version": "7.1.1",
10711+
"resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-7.1.1.tgz",
10712+
"integrity": "sha512-u6DCwbow5ynAX5BdiHQ9qvexme4U3qHW3MWe5NqH+NeBm0LbiH6zvGjNNew1fY+AZZUtVHbOPF3j7mJxbUzpXg==",
1071310713
"inBundle": true,
1071410714
"license": "BSD-2-Clause",
1071510715
"dependencies": {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"nopt": "^8.0.0",
9797
"normalize-package-data": "^7.0.0",
9898
"npm-audit-report": "^6.0.0",
99-
"npm-install-checks": "^7.1.0",
99+
"npm-install-checks": "^7.1.1",
100100
"npm-package-arg": "^12.0.0",
101101
"npm-pick-manifest": "^10.0.0",
102102
"npm-profile": "^11.0.1",

0 commit comments

Comments
 (0)