deno x npm:pagefind seemingly fails silently (doesn't spawn child process?)
- Deno version: 2.9.6
- Node.js version: 26.8.2
- Environment: macOS 27.0
On my system, this command prints nothing (except that Deno asks to install the package if it isn't cached):
deno x npm:[email protected] --version
But Deno exits with exit code 0 (success).
npx executes the pagefind executable and prints its version (as expected):
npx run pagefind 1.5.2
pagefind 1.5.2
Is this to be expected or a bug?
More info
Looking at the Pagefind package https://www.npmjs.com/package/pagefind/v/1.5.2:
Pagefind's
package.jsonspecifies a.cjsfile under"bin":"bin": "lib/runner/bin.cjs",The pagefind NPM module is a wrapper for a platform-native binary written in Rust.
The
lib/runner/bin.cjsfile determines the path for the platform-native binary and uses Nodeschild_process.spawnSyncAPI to execute it.I can tell that
deno xdoes execute thebin.cjsfile by passing--verboseto Pagefind (thebin.cjsscript recognizes the--verboseflag and prints some debug logs):deno x npm:[email protected] --version --verboseOutput:
pagefind npm wrapper: Running the executable at /Users/xyz/Library/Caches/deno/deno_x_cache/[email protected]/node_modules/.deno/@[email protected]/node_modules/@pagefind/darwin-arm64/bin/pagefind_extended pagefind npm wrapper: Process exited with status 0(You'll find these messages in the
lib/runner/bin.cjssource code)The place where it fails seems to be the spawning of the child process (at path
/Users/xyz/Library/Caches/deno/deno_x_cache/[email protected]/node_modules/.deno/@[email protected]/node_modules/@pagefind/darwin-arm64/bin/pagefind_extendedin my example, see logging above). It looks likedeno xnever spawns this child process (thus there's no output).I also tried running
deno xwith--allow-runor--allow-alland various other permission combinations, but always got the same result.
Source: denoland/deno