簡體   English   中英

vscode中windows 10中的node.js安裝錯誤

[英]node.js installation error in windows 10 in vscode

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*

您正在嘗試在未啟用 TLS 1.2 的情況下安裝 Chocolatey。 有關這方面的更多信息,請參閱此博客文章

以下內容直接取自該博客文章:

雖然您的操作系統可能支持 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

Pauby 的帖子中給出的用於啟用 TLS 1.2 的 Powershell 命令是正確的,但存在一個問題。 問題是 TLS 1.2 僅針對 session 啟用。 要檢查此關閉 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 

這對我有用。

ode:術語“節點”未被識別為 cmdlet、function、腳本文件或可運行程序的名稱。 檢查名稱的拼寫,或者如果包含路徑,請驗證路徑是否正確並重試。 在行:1 字符:1

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM