科尔多瓦创建项目

时间:2015-03-26 13:28:32

标签: windows cordova

我已经在Windows7机器上安装了Apache Cordova(截至今天的最新版本)并且正在尝试创建一个新项目。我在防火墙内,所以设置代理(npm config set proxy ...,npm config set https-proxy ...)来访问互联网。

使用以下命令:

cordova创建testApp1

我收到以下错误输出:

在位置"C:\Users\sr7\Documents\Cordova\testApp1"创建名为“HelloCordova”且ID为“io.cordova.hellocordova”的新cordova项目 下载cordova库以获取www ...

Error: tunneling socket could not be established, cause=Parse Error
    at ClientRequest.onError (C:\Users\sr7\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\request\node_modules\tunnel-agent\index.js:168:17)
    at ClientRequest.g (events.js:199:16)
    at ClientRequest.emit (events.js:107:17)
    at Socket.socketOnData (_http_client.js:315:9)
    at Socket.emit (events.js:107:17)
    at readableAddChunk (_stream_readable.js:163:16)
    at Socket.Readable.push (_stream_readable.js:126:10)
    at TCP.onread (net.js:529:20)

这似乎是一个代理问题,但如果我在国内这样做(即没有代理),虽然错误不同,但仍然失败,即

在位置"C:\Users\sr7\Documents\Cordova\testApp1"创建名为“HelloCordova”且ID为“io.cordova.hellocordova”的新cordova项目 下载cordova库以获取www ...

Error: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND wwwcache.sanger.ac.uk
    at ClientRequest.onError (C:\Users\sr7\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\request\node_modules\tunnel-agent\index.js:168:17)
    at ClientRequest.g (events.js:199:16)
    at ClientRequest.emit (events.js:107:17)
    at Socket.socketErrorListener (_http_client.js:272:9)
    at Socket.emit (events.js:107:17)
    at net.js:923:16
    at process._tickCallback (node.js:355:11)

它似乎仍在尝试找到代理“wwwcache.sanger.ac.uk”,虽然我已经从npm删除了代理信息(如果我执行“npm config ls -l”,它们都显示为null)。

任何人都可以建议一种方法来解决这个问题,最好是在防火墙内。感谢。

1 个答案:

答案 0 :(得分:1)

作为代理的幕后黑手,我遇到了与最新版本的nodejs相同的问题。

要解决此问题,请下载最新版本的tunnel-agent here

并将其放入已安装的cordova-lib的npm文件夹中:

\ NPM \ node_modules \科尔多瓦\ node_modules \科尔多瓦-LIB \ node_modules \ NPM \ node_modules \请求\ node_modules \隧道剂

信息来源:https://issues.apache.org/jira/browse/CB-8662

相关问题