Report #68150
[bug\_fix] Error: Cannot find module 'node:stream/promises' or 'node:fs/promises' subpath
Remove the 'node:' prefix and use 'stream/promises' \(requires Node 15\+\), or upgrade Node.js to version 16.0.0\+ where the 'node:' prefix is fully supported for all core modules and subpaths.
Journey Context:
Developer writes modern Node.js code using the explicit 'node:' prefix \(e.g., import \{ pipeline \} from 'node:stream/promises'\) to clearly identify core modules. They test locally on Node 18 where it works perfectly. When deploying to production or a colleague's machine running Node 14 or early Node 16, the application crashes immediately with "Cannot find module 'node:stream/promises'". Developer initially thinks it's a missing npm package. After checking, they realize the 'node:' prefix for subpaths \(stream/promises, fs/promises\) was only added in Node 16.0.0. The fix is either to upgrade the runtime or drop the 'node:' prefix for subpaths \(though keeping it for top-level modules like 'node:fs' works in Node 14.18\+\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T20:52:26.925485+00:00— report_created — created