6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

npm で [TypeError: Request path contains unescaped characters.] がでたときの対処

Posted at

何の気なしにインストールしようとすると

# npm install -g coffee-script

npm http GET https://registry.npmjs.org/coffee-script
npm ERR! TypeError: Request path contains unescaped characters.
npm ERR! at Agent.request (_http_agent.js:278: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:122:16)
npm ERR! at Agent.request (_http_agent.js:293:10)
npm ERR! at Object.exports.request (https.js:129:22)
npm ERR! at Request.start (/usr/local/lib/node_modules/npm/node_modules/request/request.js:584:30)
npm ERR! at Request.end (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1212: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 2.6.32-279.14.1.el6.x86_64
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "coffee-script"
npm ERR! cwd /root
npm ERR! node -v v0.11.9-pre
npm ERR! npm -v 1.3.13
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /root/npm-debug.log
npm ERR! not ok code 0

怒られた。

おもむろにプロトコルをhttpに変更する。。

# npm config set registry http://registry.npmjs.org/
# npm install -g coffee-script

npm http GET http://registry.npmjs.org/coffee-script
npm http 200 http://registry.npmjs.org/coffee-script
npm http GET http://registry.npmjs.org/coffee-script/-/coffee-script-1.6.3.tgz
npm http 200 http://registry.npmjs.org/coffee-script/-/coffee-script-1.6.3.tgz
/usr/local/bin/coffee -> /usr/local/lib/node_modules/coffee-script/bin/coffee
/usr/local/bin/cake -> /usr/local/lib/node_modules/coffee-script/bin/cake
coffee-script@1.6.3 /usr/local/lib/node_modules/coffee-script

# coffee -v
CoffeeScript version 1.6.3

めでたし。

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?