【发布时间】:2015-08-14 00:12:00
【问题描述】:
我正在构建一个混合移动应用程序 (Cordova),并尝试在 iOS 上运行我的构建。
我已按照documentation 中的步骤设置连接的 Mac,当我尝试在 Visual Studio 中构建代码时,我可以看到 Mac 终端响应。
我的问题是,当我使用remotebuild --secure false 启用远程构建服务器时,我在 Visual Studio 输出中收到以下错误(请注意,终端正在响应来自 Visual Studio 的构建请求,但随后因错误而失败):
无法建立到http://192.168.1.10:3000/cordova 的非安全连接。验证构建服务器未在安全模式下运行。
这是带有和输出的 Mac 终端活动:
Last login: Tue Aug 18 19:31:21 on ttys001
IBRAHIM-ALHUSSAINs-Mac-mini:~ IBRAHIMALHUSSAIN$ remotebuild --secure false
remotebuild
Copyright (C) 2014 Microsoft Corporation. All rights reserved.
1.0.1
Warning: No server modules selected. Defaulting to configuration "modules": {"taco-remote": { "mountPath": "cordova"} }
Build Retention initialized with baseBuildDir /Users/IBRAHIMALHUSSAIN/.taco_home/remote-builds/taco-remote/builds, maxBuildsToKeep 20
Initialized BuildManager with baseBuildDir /Users/IBRAHIMALHUSSAIN/.taco_home/remote-builds/taco-remote/builds; maxBuildsInQueue 10; deleteBuildsOnShutdown true; allowsEmulate true; nextBuildNumber 423
Remote build server listening on [http] port 3000
express deprecated req.host: Use req.hostname instead ../../usr/local/lib/node_modules/remotebuild/lib/server.js:257:81
GET /modules/taco-remote 200 14.494 ms - 7
New build request submitted:
/build/tasks?command=build&vcordova=4.3.0&cfg=debug&loglevel=warn
{ 'accept-language': 'en-US',
host: '192.168.1.10:3000',
connection: 'close',
'transfer-encoding': 'chunked' }
POST /cordova/build/tasks?command=build&vcordova=4.3.0&cfg=debug&loglevel=warn - - ms - -
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "taco-remote-multiplexer"
npm ERR! node v0.12.4
npm ERR! npm v2.13.4
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! network getaddrinfo ENOTFOUND registry.npmjs.org
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! Please include the following file with any support request:
npm ERR! /Users/IBRAHIMALHUSSAIN/.taco_home/node_modules/taco-remote-multiplexer/latest/npm-debug.log
我记得在某处读到我应该启用一次安全构建然后禁用它以初始化远程服务器安全配置。每当我尝试在安全构建模式remotebuild 下运行时,我都会收到此错误:
无法建立与https://192.168.1.10:3000/cordova 的安全连接。验证构建服务器是否在安全模式下运行。
我还尝试通过重新创建 PIN、生成和重置证书来解决此问题。
我该如何解决这个问题?
【问题讨论】:
-
如果您使用 --secure false,请务必在 Visual Studio 中也将“安全模式”设置为 false。 PIN 仅用于安全模式,因此不会产生任何影响。进入 Windows 的命令行并通过键入“ping 192.168.1.10”验证您实际上可以到达 192.168.1.10 - 鉴于上述错误,听起来您不能。
-
@ChuckLantz 刚刚用 Mac 终端的更多输出更新了我的问题。当我尝试从 Visual Studio 运行我的项目时,我能够同时 ping 两种方式和远程构建服务器响应,但它仍然会因上述相同的错误而失败。
标签: ios cordova visual-studio-cordova