#1383·zx

为什么`deno run`不使用`jsr:@webpod/zx`?

作者: tcely创建于 2026年1月8日更新于 2026年2月23日
标签bug

~/.cache $ DEBUG_ZX_SH=true zx_run 'jsr:@webpod/zx' <<<'console.log( await $({ verbose: true })echo Hello world! | xargs -t -n 1 echo )'

  • install -d -m 00775 /data/data/com.termux/files/../cache/zx
  • cd /data/data/com.termux/files/../cache/zx
  • zx=jsr:@webpod/zx
  • shift
  • exec deno run --no-config --allow-read=/data/data/com.termux/files/usr/bin/bash --allow-read=/data/data/com.termux/files/files/home --allow-read=/data/data/com.termux/files/../cache --ignore-read --allow-write=/data/data/com.termux/files/../cache/zx --allow-env --allow-run --allow-sys=homedir,uid,gid,cpus -- jsr:@webpod/zx ~/.cache $ DEBUG_ZX_SH=true zx_run 'npm:zx' <<<'console.log( await $({ verbose: true })echo Hello world! | xargs -t -n 1 echo )'
  • install -d -m 00775 /data/data/com.termux/files/../cache/zx
  • cd /data/data/com.termux/files/../cache/zx
  • zx=npm:zx
  • shift
  • exec deno run --no-config --allow-read=/data/data/com.termux/files/usr/bin/bash --allow-read=/data/data/com.termux/files/files/home --allow-read=/data/data/com.termux/files/../cache --ignore-read --allow-write=/data/data/com.termux/files/../cache/zx --allow-env --allow-run --allow-sys=homedir,uid,gid,cpus -- npm:zx $ echo Hello world! | xargs -t -n 1 echo echo Hello Hello echo 'world!' world! ProcessOutput { stdout: 'Hello\nworld!\n', stderr: "echo Hello\necho 'world!'\n", signal: null, exitCode: 0, duration: 124 } Only when using 'npm:zx' does the output show up. [^1] Am I doing anything wrong here? Why would it be different?

I looked into this some more. isMain returning false is the reason. These are the valid cases it should accept from debugging deno run: