Simon H Simon H - 1 year ago 468
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
(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 Source

typings install google.maps --global

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download