Simon H Simon H - 4 months ago 145
TypeScript Question

How to install Typescript typings for google maps

How can it be done - I've tried combinations of

typings install [googlemaps | google.maps] [--ambient] --save


and end up with variations on this error


typings ERR! message Unable to find "googlemaps" for "npm" in the registry.


Per Amy's suggestion, I've also download to the relevant directory and added

/// <reference path="main/ambient/google.maps/google.maps.d.ts" />


to my
main.d.ts
(a file which is clearly being read as I don't get other errors).

And I can't find anything on the web to answer the question

My end goal is to get rid of this sort of error


error TS2503: Cannot find namespace 'google'.

Answer

typings install google.maps --global

You need the --global (used to be --ambient) flag to search DefinitlyTyped