异常调用"DownloadString"带有"1"的参数:“无法连接到远程服务器". [英] Exception calling "DownloadString" with "1" argument(s): "Unable to connect to the remote server"

查看:561
本文介绍了异常调用"DownloadString"带有"1"的参数:“无法连接到远程服务器".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I just started to install NativeScript on Windows 10 with this command:

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

我从安装指南中获得的

https://docs.nativescript.org/角度/开始/快速设置

that I got from installation guide here https://docs.nativescript.org/angular/start/quick-setup

但是我收到此错误消息:

But I get this error message:

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

问题出在哪里,我该如何解决?

What is the problem and how can I fix?

推荐答案

以下步骤对我有用:

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

这篇关于异常调用"DownloadString"带有"1"的参数:“无法连接到远程服务器".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆