添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
八块腹肌的松鼠  ·  Simple Get Key ...·  4 周前    · 
体贴的拐杖  ·  黄石市医疗保障局·  3 月前    · 

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node version: v18.14.1
node a.js

/bin/sh: line 0: cd: some-random-place: No such file or directory

deno vesion: 1.36.3
deno run -A a.js

/bin/sh: line 0: cd: some-random-place: No such file or directory

node throws while deno doesn't, aren't they expected to behave the same?

Not sure when it was fixed but latest version of deno now matches the behaviour of node:

➜ bat -p t.mjs
import { execSync } from "node:child_process";
try {
  execSync("cd some-random-place");
} catch (error) {
  console.log("oops");
➜ deno --version
deno 1.41.0 (release, aarch64-apple-darwin)
v8 12.1.285.27
typescript 5.3.3
➜ deno run -A t.mjs
/bin/sh: line 0: cd: some-random-place: No such file or directory
➜ node t.mjs
/bin/sh: line 0: cd: some-random-place: No such file or directory

Closing this issue as resolved.