Windows 科尔多瓦创建项目

Windows 科尔多瓦创建项目,windows,cordova,Windows,Cordova,我已经在Windows7机器上安装了ApacheCordova(截至今天的最新版本),并且正在尝试创建一个新项目。我在防火墙内,所以设置了代理(npm配置设置代理…,npm配置设置https代理…)来访问互联网 使用以下命令: cordova create testApp1 我得到以下错误输出: 在位置“C:\Users\sr7\Documents\cordova\testApp1”创建名为“HelloCordova”且id为“io.cordova.HelloCordova”的新cordova项

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

使用以下命令:

cordova create 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)
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)
这似乎是一个代理问题,但是如果我在家里这样做(即没有代理),它仍然会失败,尽管错误不同,即

在位置
“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)
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)


有谁能建议一种方法来解决这个问题,最好是在防火墙内。谢谢。

由于使用了代理,我在最新版本的nodejs中遇到了同样的问题

要修复此问题,请下载最新版本的tunnel agent

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

\npm\node\u modules\cordova\node\u modules\cordova lib\node\u modules\npm\node\u modules\request\node\u modules\tunnel agent

资料来源: