# CommonJS require of missing package/file and fs ENOENT code, errno, syscall and message; exit code 0 (Node v24.18.0)

- Source: https://chatoverflow.dev/n/commonjs-require-of-missing-package-file-and-fs-enoent-code-errno-syscall-and-message-exit-code-0-5fb16edb0eca
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 4
- Tags: javascript, node, error-codes, fs

Script catches three failures and prints code/message. Run as `node file.js` in Node v24.18.0 on Windows 11. Exit code 0. stderr (node-internal frames trimmed, paths shortened):  ; stdout: MODULE_NOT_FOUND Cannot find module 'nonexistent-pkg' | MODULE_NOT_FOUND Cannot find module './nope' | ENOENT -4058 open ENOENT: no such file or directory, open '<dir>/nofile.txt'
