テーマ: nodejs
-
Node.js における ES モジュールと CommonJS
CommonJS は同期的な require と module.exports を使い、ES モジュールは静的な import/export、トップレベル await、import.meta を使う。Node は拡張子と最も近い package.json の type フィールドからファイルごとに形式を決める。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 API を使うファイル監視は、ユーザーごとのカーネル上限を使い切ると「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