【问题标题】:node.js installation error in windows 10 in vscodevscode中Windows 10中的node.js安装错误
【发布时间】:2020-10-18 13:27:58
【问题描述】:
Exception calling "DownloadString" with "1" argument(s): "The request was aborted: Could not create SSL/TLS secure
channel."
At line:1 char:1
+ iex ((New-Object System.Net.WebClient).DownloadString('https://chocol ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException
choco : The term 'choco' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:95
+ ... .DownloadString('https://chocolatey.org/install.ps1')); choco upgrade ...
+                                                             ~~~~~
    + CategoryInfo          : ObjectNotFound: (choco:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException*

【问题讨论】:

标签: javascript html node.js chocolatey


【解决方案1】:

您尝试在未启用 TLS 1.2 的情况下安装 Chocolatey。有关更多信息,请参阅this blog post

以下内容直接取自该博文:

虽然您的操作系统可能支持 TLS 1.2,但请务必记住它可能必须启用。如果您使用 PowerShell 工作,您可以通过运行以下代码了解您的系统支持哪些协议:

[Enum]::GetNames([Net.SecurityProtocolType]) -contains 'Tls12'

如果结果为 True,则您的系统支持 TLS 1.2。您可以通过运行找出正在使用的协议:

[System.Net.ServicePointManager]::SecurityProtocol.HasFlag([Net.SecurityProtocolType]::Tls12)

如果结果为 True,则使用 TLS 1.2。但是,您可以使用以下命令显式添加 TLS 1.2:

[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12

【讨论】:

    【解决方案2】:

    Pauby 的帖子中给出的启用 TLS 1.2 的 Powershell 命令是正确的,但存在一个问题。问题是 TLS 1.2 仅针对该会话启用。要检查此关闭 powershell 并再次打开 powershell。现在检查 TLS1.2 状态。尽管您将其设置为 true,但它会显示“False”。要将 TLS 1.2 作为默认设置或用于其他会话,请在 Powershell 中运行以下命令。(这些脚本取自 https://johnlouros.com/blog/enabling-strong-cryptography-for-all-dot-net-applications

    Set-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord 
    
    Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord 
    

    这对我有用。

    【讨论】:

      【解决方案3】:

      ode:术语“节点”未被识别为 cmdlet、函数、脚本文件或可运行程序的名称。检查名称的拼写,或者如果包含路径,请验证 路径正确,然后重试。 在 line:1 char:1

      • 节点-v
      •   + CategoryInfo          : ObjectNotFound: (node:String) [], CommandNotFoundException
          + FullyQualifiedErrorId : CommandNotFoundException
        

      【讨论】:

        猜你喜欢
        • 2019-08-02
        • 2018-11-23
        • 2016-01-11
        • 2023-01-15
        • 2021-12-25
        • 1970-01-01
        • 2018-04-10
        • 2018-12-29
        • 1970-01-01
        相关资源
        最近更新 更多