主机名/ IP与证书的altname不匹配

时间:2018-09-01 13:15:15

标签: javascript react-native npm yarnpkg

我正在开发一个React Native项目,从private void AddCategoryFunc(object sender, RoutedEventArgs e) { UserControl categoryMod = new CategoryModule(); CategoriesWraper.Children.Add(categoryMod); } 安装软件包的任何尝试都会失败,并出现以下错误。

<!DOCTYPE HTML>
<html>
<head>
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
<script type="text/javascript">

window.onload = function () {
	var chart = new CanvasJS.Chart("chartContainer", {
		title:{
			text: "LIST RECORD"              
		},
		data: [              
		{
			type: "column",
			dataPoints: [
				{ label: "Sold",  y: '$rowcount1'  },        //Properly insert count?
				{ label: "Rejected", y: '$rowcount2'  },     //Properly insert count?
			]
		}
		]
	});
	chart.render();
}
</script>
</head>
<body>
<div id="chartContainer" style="height: 300px; width: 60%;"></div>
</body>
</html>

    <?php
error_reporting(0);
// connect to the database
$conn = mysqli_connect("localhost", "root", "", "order");
$sql="SELECT * FROM order.item WHERE status IN ('Sold')";
if ($result=mysqli_query($conn,$sql))
  {
  $rowcount1=mysqli_num_rows($result);
  mysqli_free_result($result);
  }
mysqli_close($conn);
?>

<?php
error_reporting(0);
// connect to the database
$conn = mysqli_connect("localhost", "root", "", "arc");
$sql="SELECT * FROM order.item WHERE status IN ('Rejected')";
if ($result=mysqli_query($conn,$sql))
  {
  $rowcount2=mysqli_num_rows($result);
  mysqli_free_result($result);
  }
mysqli_close($conn);
?>

在寻找其他解决方案时,我尝试将npm中的fitz:tesseractOcrSample fitzmode$ npm i npm ERR! request to https://registry.npmjs.org/react failed, reason: Hostname/IP doesn't match certificate's altnames: "Host: registry.npmjs.org. is not in the cert's altnames: DNS:a.sni.fastly.net, DNS:a.sni.global-ssl.fastly.net" npm ERR! A complete log of this run can be found in: npm ERR! /Users/fitzmode/.npm/_logs/2018-09-01T13_08_53_778Z-debug.log 设置为strict-ssl,但无济于事。

我也尝试使用false来代替,但是得到以下内容。

npm config

我不确定在我的网络或其他方面是否配置错误。有解决方案吗?

3 个答案:

答案 0 :(得分:2)

这对我有用

我已经编辑了/ etc / hosts文件并创建了这样的条目

104.16.109.30   registry.npmjs.org

它有效。

答案 1 :(得分:0)

已解决

我将计算机上的DNS提供程序更改为OpenDNS。显然,npm registry上的配置错误可能由我的ISP缓存。

Preferences > Network > Advanced > DNS (Tab)中,我已将208.67.222.222和208.67.220.220添加到DNS服务器列表中。

此处更多信息here

答案 2 :(得分:0)

这对我有用

添加

104.16.16.35    registry.yarnpkg.com

到/ etc / hosts