1

Following the Angular 2 5 minutes quickstart, I wanted to install Angular 2 definitions (for TypeScript compiler and my IDE) provided by DefinitelyTyped using their package manager, tsd.

So I typed this command on a terminal

tsd query angular2 --action install

And all I got is the following error

>> tsd 0.5.7
_http_client.js:73
    throw new TypeError('Request path contains unescaped characters.');
          ^
TypeError: Request path contains unescaped characters.
    at new ClientRequest (_http_client.js:73:11)
    at TunnelingAgent.exports.request (http.js:49:10)
    at TunnelingAgent.createSocket (/usr/local/lib/node_modules/tsd/node_modules/request/node_modules/tunnel-agent/index.js:117:25)
    at TunnelingAgent.createSecureSocket [as createSocket] (/usr/local/lib/node_modules/tsd/node_modules/request/node_modules/tunnel-agent/index.js:184:41)
    at TunnelingAgent.addRequest (/usr/local/lib/node_modules/tsd/node_modules/request/node_modules/tunnel-agent/index.js:80:8)
    at new ClientRequest (_http_client.js:154:16)
    at Object.exports.request (http.js:49:10)
    at Object.exports.request (https.js:136:15)
    at Request.start (/usr/local/lib/node_modules/tsd/node_modules/request/request.js:582:30)
    at Request.end (/usr/local/lib/node_modules/tsd/node_modules/request/request.js:1226:28)

After some search, I check my settings (npm, tsd and git) for proxy, which is well set so it is not that. I'm using tsd version 0.5.7.

Have you got any idea on how to fix this ?

Edit 05/18:

A simple query like tsd query angular2 returns me the same error, and tsd install angular2 is not a valid command, calling it returns me result of tsd --help telling me that I must run tsd query [pkgname] --action insall to install a package.

Edit upgrading to 0.6.0:

After upgrading to version 0.6.0 that had just been released, no problem anymore.

Both tsd install [pkg] and tsd query [pkg] --action install work like a charm.

Blackus
  • 6,883
  • 5
  • 40
  • 51

1 Answers1

1

I've been using tsd for a few months now and have not used --action install off of a query result

I have been using version: tsd 0.6.0-beta.5 to handle my querying and installations via:

To search for a definition I use: tsd query [pkg name]

To install a definition I use: tsd install [pkg name]

I use tsd install angular2 --save to setup my angular2 project in conjunction with tsd init which creates a tsd.json to track all of my definition dependencies and keep the typings files out of version control

Community
  • 1
  • 1
Brocco
  • 62,737
  • 12
  • 70
  • 76
  • I'll give it a try back to work and tell you, thanks ! – Blackus May 15 '15 at 15:31
  • Hi, after testing `tsd query` give me the same error and `tsd install` returns me a *command not found* error. Help tells me to use `tsd query [pkg] --action install` to install a package. For information, I'm using tsd 0.5.7 – Blackus May 18 '15 at 08:33
  • 1
    There may have been a change in versions, I am using version `tsd 0.6.0-beta.5` and it appears to have been added after the release you are using. – Brocco May 18 '15 at 12:39
  • Yep you're right, I edited my question earlier. Can you edit your answer to point the fact that tsd needed to be updated so that I can accept it ? – Blackus May 18 '15 at 13:56