TypeError:请求路径包含未转义的字符 [英] TypeError: Request path contains unescaped characters

查看:3007
本文介绍了TypeError:请求路径包含未转义的字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  npm install express 

但我收到此错误:

  npm http GET https://registry.npmjs.org/express 
npm ERR! TypeError:请求路径包含未转义的字符。
npm ERR!在Agent.request(_http_agent.js:264:11)
npm ERR!在TunnelingAgent.exports.request(http.js:52:22)
npm ERR!在TunnelingAgent.createSocket(/usr/local/lib/node_modules/npm/node_modules/request/node_modules/tunnel-agent/index.js:117:25)
npm ERR!在TunnelingAgent.createSecureSocket [as createSocket](/usr/local/lib/node_modules/npm/node_modules/request/node_modules/tunnel-agent/index.js:184:41)
npm ERR!在TunnelingAgent.addRequest(/usr/local/lib/node_modules/npm/node_modules/request/node_modules/tunnel-agent/index.js:80:8)
npm ERR!在新的ClientRequest(_http_client.js:112:16)
npm ERR!在Agent.request(_http_agent.js:279:10)
npm ERR!在Object.exports.request(https.js:130:22)
npm ERR!在request.start(/usr/local/lib/node_modules/npm/node_modules/request/index.js:594:30)
npm ERR!在request.end(/usr/local/lib/node_modules/npm/node_modules/request/index.js:1186:28)
npm ERR!如果您需要帮助,可以在以下位置报告此日志:
npm ERR! < HTTP://github.com/isaacs/npm/issues>
npm ERR!或发送电子邮件至:
npm ERR! < npm-@googlegroups.com>

npm ERR!系统Linux 3.6.11-7.fc16.x86_64
npm ERR!命令/ usr / local / bin / node/ usr / local / bin / npminstallexpress
npm ERR! cwd / usr / local / src / node
npm ERR!节点-v v0.11.5-pre
npm ERR! npm -v 1.3.5
npm ERR!
npm ERR!额外的日志记录详细信息可以在以下位置找到:
npm ERR! /usr/local/src/node/npm-debug.log
npm ERR!不确定代码0

可能发生我使用代理我设置这样,允许从ips在我的网络之外

  export https_proxy ='http://172.21.0.12:3128'

我希望你能帮助我

解决方案

p>从命令行设置代理

  npm config set proxy http:// proxydomain:port / 

如果发生错误,请再次尝试。

 code> npm配置设置注册表http://registry.npmjs.org/ 

这些工作为了我。
(ref http://sushichop.blogspot.jp/2013/01 /npm-install.html


I try to install node.js modules using:

npm install express

but I get this error:

npm http GET https://registry.npmjs.org/express
npm ERR! TypeError: Request path contains unescaped characters.
npm ERR!     at Agent.request (_http_agent.js:264:11)
npm ERR!     at TunnelingAgent.exports.request (http.js:52:22)
npm ERR!     at TunnelingAgent.createSocket (/usr/local/lib/node_modules/npm/node_modules/request/node_modules/tunnel-agent/index.js:117:25)
npm ERR!     at TunnelingAgent.createSecureSocket [as createSocket] (/usr/local/lib/node_modules/npm/node_modules/request/node_modules/tunnel-agent/index.js:184:41)
npm ERR!     at TunnelingAgent.addRequest (/usr/local/lib/node_modules/npm/node_modules/request/node_modules/tunnel-agent/index.js:80:8)
npm ERR!     at new ClientRequest (_http_client.js:112:16)
npm ERR!     at Agent.request (_http_agent.js:279:10)
npm ERR!     at Object.exports.request (https.js:130:22)
npm ERR!     at Request.start (/usr/local/lib/node_modules/npm/node_modules/request/index.js:594:30)
npm ERR!     at Request.end (/usr/local/lib/node_modules/npm/node_modules/request/index.js:1186:28)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 3.6.11-7.fc16.x86_64
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "express"
npm ERR! cwd /usr/local/src/node
npm ERR! node -v v0.11.5-pre
npm ERR! npm -v 1.3.5
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /usr/local/src/node/npm-debug.log
npm ERR! not ok code 0

May be happening I use a proxy I set it up this way to allow downloads from ips outside my network

export https_proxy='http://172.21.0.12:3128'

I hope you can help me

解决方案

Set proxy from commandline.

npm config set proxy http://proxydomain:port/

If error occur yet, additional try next.

npm config set registry http://registry.npmjs.org/

These work for me. (ref http://sushichop.blogspot.jp/2013/01/npm-install.html)

这篇关于TypeError:请求路径包含未转义的字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆