I am getting an UNABLE_TO_VERIFY_LEAF_SIGNATURE error when I try to install hexo-cli on Windows. I have tried switching to another mirror but that did not fix the problem.
            Asked
            
        
        
            Active
            
        
            Viewed 1.4k times
        
    7
            
            
        
        Don Cruickshank
        
- 5,641
 - 6
 - 48
 - 48
 
        Jerry
        
- 91
 - 1
 - 1
 - 7
 
- 
                    Embedding the screenshot directly in the post makes it more obvious what it is about. – aschipfl Aug 23 '16 at 18:38
 
2 Answers
9
            
            
        Are you behind a corporate proxy? They are most likely intercepting & MiTM'ing the traffic with a self signed SSL certificate.
A hacky solution is just to turn off SSL for NPM
npm set strict-ssl false
More detailed instructions can be found here: How to fix SSL certificate error when running Npm on Windows?
References:
        Carlos Sultana
        
- 709
 - 5
 - 11
 
- 
                    How to explain about Err Windows_NT 6.1.7601?Does it means my windows version can not compatible with npm? – Jerry Aug 24 '16 at 01:44
 - 
                    1
 
0
            
            
        Please, follow instructions described here:
How to fix SSL certificate error when running Npm on Windows?
As the author suggests, the point here to use NODE_EXTRA_CA_CERTS environment variable. Keep in mind that setting npm config set cafile <path> causes npm to only use the certs provided in that file, instead of extending the existing ones with it.
        flags
        
- 461
 - 5
 - 11
 
