Efrain Efrain - 1 month ago 7
TypeScript Question

Typings: 'typings search' finds a package, but 'typings install' fails

I'm trying to install the Google Auth2 typings with 'typings':

> typings search gapi.auth2


returns

NAME SOURCE HOMEPAGE DESCRIPTION VERSIONS UPDATED
gapi.auth2 dt https://developers.google.com/identity/sign-in/web/ 1 2016-03-19T05:16:41.000Z


but then

> typings install gapi.auth2


fails:

typings ERR! message Unable to find "gapi.auth2" ("npm") in the registry. Did you want to try searching another source? Also, if you want contribute these typings, please help us: https://github.com/typings/registry
typings ERR! caused by https://api.typings.org/entries/npm/gapi.auth2/versions/latest responded with 404, expected it to equal 200


I don't understand why that is happening, I mean, it does find the package, no? What am I missing?

Answer

I found the solution:

typings install dt~gapi.auth2 --global

so the key is the prefix dt~ which indicates the package source (definitely typed, in this case) - and which can be seen in the search output as well.