installation - 使用 "DownloadString"参数调用 "1"的异常 : "Unable to connect to the remote server"

标签 installation windows-10 runtime-error nativescript

我刚刚开始使用以下命令在 Windows 10 上安装 NativeScript:

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://www.nativescript.org/setup/win'))"

我从这里的安装指南中得到的https://docs.nativescript.org/angular/start/quick-setup

但我收到此错误消息:

Exception calling "DownloadString" with "1" argument(s): "Unable to connect to the remote server"
At line:1 char:1
+ iex ((new-object net.webclient).DownloadString('https://www.nativescr ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException


C:\Windows\system32>@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://www.nativescript.org/setup/win'))"
Exception calling "DownloadString" with "1" argument(s): "Unable to connect to the remote server"
At line:1 char:1
+ iex ((new-object net.webclient).DownloadString('https://www.nativescr ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException

问题是什么,我该如何解决?

最佳答案

以下步骤对我有用:

  1. 从 URL ( https://www.nativescript.org/setup/win ) 下载文件。
  2. 以管理员身份运行 cmd 并 cd 到您下载文件的目录。
  3. 在 cmd 中执行以下命令:powershell -noexit "& "./native-script.ps1"""

关于installation - 使用 "DownloadString"参数调用 "1"的异常 : "Unable to connect to the remote server",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56532248/

相关文章:

c# - 使用 MediaCapture 时纵横比/缩放级别发生变化的问题?

android - 程序类型已经存在 com google protobuf DescriptorProtos

asynchronous - QUnit 异步测试设置和拆卸

installation - 在 Windows 7 上安装 Visual Studio 2015 社区版

visual-studio-2013 - 如何在 Visual Studio 2013 中使用 Edge 作为默认浏览器?

SQL Server 2008 r2 : How to check all views for runtime errors?

c - 从数组中选择最大子数组

ide - Aptana Studio 3 IDE 的安装目录是什么?

wix - 如何将 msiexec 属性传递给 WiX C# 自定义操作?

winrt-xaml - Windows UAP : get page current visual state