Fix:
I ran the command suggested: openssl s_client -connect registry.npmjs.org:443 -cipher AESGCM <NUL
. However, I got the error: Verify return code: 20 (unable to get local issuer certificate).
The CA certificate was missing. So, I followed these steps:
I installed the certificate from here. "GTS Root R4" certificate is used by npmjs.org
Added certificate path using this command setx NODE_EXTRA_CA_CERTS <path to certificate>
Verified the path using this command node -p "process.env.NODE_EXTRA_CA_CERTS"
If the correct file path is displayed, the setting was applied successfully.