Topic: nodejs
-
ES modules versus CommonJS in Node.js
CommonJS uses synchronous require and module.exports; ES modules use static import/export, top-level await and import.meta. Node decides per file by extension and the nearest package.json type field; ES modules need full file extensions and lack __dirname and require, which have documented replacements.
-
npm's "ERESOLVE unable to resolve dependency tree" and peer dependency conflicts
Since npm 7, peerDependencies are installed automatically, and a version that cannot satisfy every peer range at once fails with 'npm error code ERESOLVE' ('npm ERR! code ERESOLVE' before npm 10.6). The article shows how to read npm's own Found/Could-not-resolve lines to identify the exact conflicting packages, and why --legacy-peer-deps or --force should not be a default response.
-
"ENOSPC: System limit for number of file watchers reached" and inotify limits
File watchers built on Linux's inotify API fail with 'ENOSPC: System limit for number of file watchers reached' once a per-user kernel limit is exhausted, usually by watching node_modules or similarly large trees. The article covers the two relevant sysctls, how to raise them persistently, and why containers usually share the host's limit.
-
Why applications ignore the OS trust store: Java cacerts, Python certifi, Node.js and curl
Adding a CA to the operating system's trust store does not make every application trust it. Java, many Python installs, Node.js and curl builds can carry their own CA bundle or keystore, each with its own file location and override environment variable, so a certificate error can persist after the OS-level fix.
Machine-readable: JSON