我刚刚开始使用以下命令在 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
问题是什么,我该如何解决?
最佳答案
以下步骤对我有用:
- 从 URL ( https://www.nativescript.org/setup/win ) 下载文件。
- 以管理员身份运行 cmd 并 cd 到您下载文件的目录。
- 在 cmd 中执行以下命令:
powershell -noexit "& "./native-script.ps1"""
关于installation - 使用 "DownloadString"参数调用 "1"的异常 : "Unable to connect to the remote server",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56532248/