ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

bug: TypeError: Request path contains unescaped char

Open perrygovier opened this issue 11 years ago • 42 comments

From @Kyozatch on March 19, 2015 8:43

Type: bug

Platform: all

Hi,

I just downloaded ionic. I created the project without any problem but, when i tried "ionic platform add android" i got an error : "npm http GET https://registry.npmjs.org/cordova-android/3.7.1 TypeError: Request path contains unescaped characters."

I was looking for a solution on google, it seems to be a proxy problem. However, I already set my proxy config and it works..

ionic : 1.3.16 cordova : 4.3.0 node : 0.12.0

Thanks

Copied from original issue: driftyco/ionic#3355

perrygovier avatar Mar 20 '15 20:03 perrygovier

@kyozatch - does this keep happening every time you run it?

What did you set your proxy settings to?

jbavari avatar Mar 25 '15 17:03 jbavari

Yes everytime. I tried on an other free BOX and it works. But with my corporate proxy, it seems pretty complicated.

My .npmrc file : proxy=http://myproxy:myport/ registry=http://registry.npmjs.org/ https-proxy=http://myproxy:myport/ strict-ssl=false

I did set my environment variables in Windows too.

This config has already been tested and works. Did i miss something else ?...

Zatchou avatar Mar 26 '15 09:03 Zatchou

++ same problem on my side. I don't want to downgrade node. seems to be a problem with Cordova rather than ionic because the following command produces also the error :

cordova platform add android

(downgrading node to 0.10.29 does solve the issue, but is lame)

r-cohen avatar Mar 27 '15 10:03 r-cohen

Did anybody come up with some solution to this problem without downgrading node? it is not a matter of proxy or environment variable - there is some problem with cordova.

geisi93 avatar Apr 09 '15 14:04 geisi93

Same problem here, solved the issue downgrading node to 0.10.29

jonmikelm avatar Apr 20 '15 07:04 jonmikelm

Same problem tried following : npm config set proxy http://proxydomain:port/ npm config set registry http://registry.npmjs.org/

Tried following versions with error : Cordova 4.3.0 Cordova 4.0.0

pulsee avatar Apr 20 '15 12:04 pulsee

I didn't want to downgrade node, so I found another solution somewhere in the Web:

Replace the content of C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\request\node_modules\tunnel-agent

with the content of this zip:

https://github.com/mikeal/tunnel-agent

however, you will probably need to configure the proxy settings as well:

npm config set proxy http://proxy:port set PROXY=http://proxy:port

geisi93 avatar Apr 20 '15 13:04 geisi93

Same problem here

arlyxiao avatar May 04 '15 10:05 arlyxiao

Hi, same problem on Windows with :

  • cordova : 5.0
  • npm : 2.7.4
  • node: v0.12.2

Cooker-Monster avatar May 06 '15 08:05 Cooker-Monster

@geisi93 That works, thanks!

generic-user avatar May 07 '15 14:05 generic-user

for those who still have problems - propably you have to replace the contents of

C:\Users{USERNAME}\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\request\node_modules\tunnel-agent

with the contents of with the content of this zip:

https://github.com/mikeal/tunnel-agent

too.

geisi93 avatar May 13 '15 13:05 geisi93

@geisi93 you are a star! worked perfectly

s0th avatar May 13 '15 16:05 s0th

Hi , i am facing request path contains unescaped characters even after setting proxy and registry , and even changed the contents of tunnel_agent.

faizaghaazfaiz avatar May 18 '15 07:05 faizaghaazfaiz

I have installed node v0.12.3 , cordova 5.0.0 ,npm 2.9.1 please guide me , what i am doing wrong...

faizaghaazfaiz avatar May 18 '15 08:05 faizaghaazfaiz

look at the console, there you can see the path of the tunnel-agent where the problem occurs. make sure to replace the tunnel-agent exactly in the path, that is shown in the console!

geisi93 avatar May 18 '15 09:05 geisi93

Just try the new version of node v0.12.3, but unfortunately they haven't fixed this issue...

jason5149 avatar May 19 '15 09:05 jason5149

Had same issue when trying to run crosswalk, dropped node version back down to 0.10.33, worked fine after that.

DarrylD avatar May 19 '15 18:05 DarrylD

I tried @DarrylD's solution. Works perfectly for me. Have a good day.

Zatchou avatar May 20 '15 08:05 Zatchou

thanks geisi93, your solution worked like a charm...

vishal2511 avatar May 20 '15 09:05 vishal2511

Thanks @geisi93, works perfectly for me too :)

ygayl avatar May 21 '15 00:05 ygayl