Тема: nodejs
-
ES-модули и CommonJS в Node.js
CommonJS использует синхронный require и module.exports; ES-модули — статические import/export, await верхнего уровня и import.meta. Node определяет формат каждого файла по расширению и полю type ближайшего package.json. Для ES-модулей нужны полные расширения файлов; __dirname и require в них отсутствуют, но имеют документированные замены.
-
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» и лимиты inotify
Наблюдатели за файлами на основе Linux inotify завершаются ошибкой «ENOSPC: System limit for number of file watchers reached», когда исчерпан лимит ядра на пользователя, обычно из-за node_modules или столь же больших деревьев. Статья описывает два нужных sysctl, их постоянное увеличение и причину, по которой контейнеры обычно делят лимит хоста.
-
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.
Машиночитаемо: JSON