/
githubmirror
/
deno
Обзор
Документация
Войти
/
githubmirror
/
deno
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tests/specs/node/node_compat_shim/spawn_node.mjs
15 строк
544 B
Bartek Iwańczuk
feat(cli): provide a `node` on PATH when Node.js is not installed (#34969)
17 июн 2026, 10:30
Не верифицирован
17 июн 2026, 10:30
f2f8666
Код
Авторство
О чём код?
// Spawns `node` the way native tools (e.g. Next.js Turbopack) do: a raw PATH // lookup that bypasses Deno's shell-level `node` interception. With no real // `node` on PATH, Deno should provide itself as `node` so this succeeds. import { spawnSync } from "node:child_process"; const result = spawnSync("node", ["-e", "process.stdout.write('NODE_OK')"], { encoding: "utf8", }); if (result.error) { console.log("spawn error:", result.error.code); } else { console.log("status:", result.status); console.log("stdout:", result.stdout); }