Google maps TypeScript error: Cannot find name 'google' - discussion

This discussion didnt seem to take off but i’ve found a more complete solution than the one I mentioned in my question which was copying and pasting things into the typings folder.

Instead what you can do is:

  1. Install the TypeScript Definition Manager CLI using npm… npm install typings --global

  2. Then use your CLI to navigate into your Ionic 2 project’s folder

  3. And finally, install the google map definition files using the typings CLI… typings install dt~google.maps --global


Once you have done this you should end up with the following files in your project’s typings > global > google.maps directory:

  • index.d.ts

  • typings.json

Also, you don’t need to add reference path to the top of the files that use google maps. In my original solution I did have to do this.

This issue on GitHub helped me with step 3!

4 Likes