Home > Mobile >  How to set $env:NODE_EXTRA_CA_CERTS to "default" value?
How to set $env:NODE_EXTRA_CA_CERTS to "default" value?

Time:12-09

While trying to solve a Node certificates issue on my local, I had to set $env:NODE_EXTRA_CA_CERTS="D:\Source\project\fe\client.certificate.cer"

If I remove the above "client.certificate.cer" from the disk, each time I run an npm command, npm looks for the above certificate "D:\Source\project\fe\client.certificate.cer" and gives me a warning that it's no longer the disk.

Warning: ignoring extra certs from 'D:\Source\project\fe\client.certificate.cer', load failed: error:02001002:system library:fopen:No such file or directory.

npm WARN config global '--global', '--local' are deprecated. Use '--location=global' instead.

Warning: ignoring extra certs from 'D:\Source\project\fe\client.certificate.cer', load failed: error:02001002:system library:fopen:No such file or directory.

In order to set up the value of the $env:NODE_EXTRA_CA_CERTS= to a "default" one I run $env:NODE_EXTRA_CA_CERTS=C:\Users\myuser\AppData\Local\mkcert\rootCA.pem. It works for the current instance of PowerShell, but if I run another one or I restart the PC, it returns to "D:\Source\project\fe\client.certificate.cer"

How can I update the value of $env:NODE_EXTRA_CA_CERTS permanently?

CodePudding user response:

To update the value of $env:NODE_EXTRA_CA_CERTS permanently, you will need to modify your system environment variables.

  • Related