npm 依赖下载报错 Hostname/IP does not match certificate‘s 相关 解决方案

时间:2025-04-25 08:07:42

npm 依赖下载报错:

Hostname/IP does not match certificate's altnames: Host: . is not in the cert's altnames: DNS:

开始怀疑是电脑node环境出现问题,各种卸载重装,然并卵,最后在一个博主帖子里找到思路,记录下艰难爬坑路..............  

第一步 :

尝试使用   

npm set strict-ssl false  
 
npm config set registry /

亲测有效,如果报相同的错误可以尝试使用!