HTTP and HTTPS Node.js Logging | Generated by AI

Home 2026.04

Question: Give me the command about NODE options to log HTTP and HTTPS logs, related to npm install –verbose.

Answer:

To enable detailed logging of HTTP and HTTPS requests made by Node.js (including those triggered during npm install, such as fetching packages from the registry), use the built-in NODE_DEBUG environment variable.

Primary Command for HTTP/HTTPS Logging

Run this before your npm command (on Unix-like systems like Linux/macOS):

NODE_DEBUG=http,https npm install --verbose

On Windows (Command Prompt):

set NODE_DEBUG=http,https && npm install --verbose

On Windows (PowerShell):

$env:NODE_DEBUG="http,https"; npm install --verbose

What This Does

You can also include more modules for broader debugging:

NODE_DEBUG=http,https,http2,tls npm install --verbose

Additional Useful NODE_OPTIONS

You can pass Node.js flags via the NODE_OPTIONS environment variable (npm supports this for lifecycle scripts too):

NODE_DEBUG=http,https NODE_OPTIONS="--trace-warnings" npm install --verbose

Or combine with npm’s own HTTP logging level:

NODE_DEBUG=http,https npm install --loglevel=http --verbose

Tips

This is the standard, built-in way to get low-level HTTP/HTTPS logs without installing extra packages.

References:


Back Donate