0

We're using the PhoneGap Build CLI on two separate machines, with no difference in node environments that we can tell. On one of the machines, it works without issues. On the other, we get the following message:

[phonegap] compressing the app...
[phonegap] uploading the app...
_http_client.js:53
    throw new TypeError('Request path contains unescaped characters');
    ^

TypeError: Request path contains unescaped characters
    at new ClientRequest (_http_client.js:53:11)
    at Object.exports.request (http.js:31:10)
    at TunnelingAgent.exports.request (https.js:199:15)
    at TunnelingAgent.createSocket (/usr/local/lib/node_modules/phonegap/node_modules/phonegap-build-api/node_modules/request/tunnel.js:116:25)
    at TunnelingAgent.createSecureSocket [as createSocket] (/usr/local/lib/node_modules/phonegap/node_modules/phonegap-build-api/node_modules/request/tunnel.js:188:41)
    at TunnelingAgent.addRequest (/usr/local/lib/node_modules/phonegap/node_modules/phonegap-build-api/node_modules/request/tunnel.js:80:8)
    at new ClientRequest (_http_client.js:158:16)
    at Object.exports.request (http.js:31:10)
    at Object.exports.request (https.js:199:15)
    at Request.start (/usr/local/lib/node_modules/phonegap/node_modules/phonegap-build-api/node_modules/request/main.js:516:30)

After sniffing through the request that's being sent to _http_client.js, the one that succeeds has proxy: undefined set and the one that fails has proxy: true set.

We haven't knowingly set or amended anything to do with the proxy settings. We've also tried reinstalling node.

We're using node 6.3.0 and phonegap 6.2.9.

Also worth adding is that we run npm config list on both machines, neither have a proxy set up.

Any advice appreciated!

wa-rren-dev
  • 327
  • 1
  • 4
  • 12
  • Post the line of code that is throwing the exception. I suspect that you have some URL that's not properly encoded. – Racil Hilan Jul 27 '16 at 21:24

2 Answers2

0

Not a solution per se but we resolved this by downgrading phonegap to 6.2.9. Issue disappeared straight away.

wa-rren-dev
  • 327
  • 1
  • 4
  • 12
0

Check the version of phonegap:

    phonegap -v

If you have the version 6.3.0, you must to do that:

     Downgrade phonegap: npm install -g phonegap@6.2.9
     Check version: phonegap -v     (6.2.9)