Skip to content

Commit bc68467

Browse files
authored
docs: add libc option to package.json documentation (#1256)
This has been implemented in npm/npm-install-checks#54, but it seems to have never been documented.
1 parent 5b5267d commit bc68467

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

content/cli/v10/configuring-npm/package-json.mdx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,26 @@ Like the `os` option, you can also block architectures:
905905
906906
The host architecture is determined by `process.arch`
907907
908+
### libc
909+
910+
If your package only supports certain libc implementations, you can specify which ones. When running on non-Linux systems, any specified value for libc will fail the check.
911+
912+
```json
913+
{
914+
"libc": ["glibc", "musl"]
915+
}
916+
```
917+
918+
Similarly as with `os` and `cpu`, you can also block certain libc implementations:
919+
920+
```json
921+
{
922+
"libc": ["!glibc"]
923+
}
924+
```
925+
926+
Libc implementations is inferred by inspecting `process.report.glibcVersionRuntime` in the case of glibc or `process.report.sharedObjects` in the case of musl.
927+
908928
### private
909929
910930
If you set `"private": true` in your package.json, then npm will refuse to publish it.

0 commit comments

Comments
 (0)