Fix Node.js "Error [ERR_MODULE_NOT_FOUND]: Cannot find module" in ES Modules
When "type": "module" is configured in package.json, Node.js ECMAScript Modules (ESM) resolver strictly requires explicit relative file extensions (.js) and cannot auto-resolve .ts or directories without index.js.
Error [ERR_MODULE_NOT_FOUND]: Cannot find module
Quick Fix Checklist
- Always append .js to relative imports when targeting Node ESM (even in TypeScript source files)
- Use a bundler (Vite, TSX, esbuild, Rollup) if you desire extensionless imports
- Check package.json for "type": "module" and verify path spellings