【问题标题】:Angular 7 error:- error TS2503: Cannot find namespace 'google'Angular 7 错误:- 错误 TS2503:找不到命名空间“google”
【发布时间】:2020-02-26 01:08:47
【问题描述】:

我收到此错误我尝试了一些来自 stackoverflow 的解决方案,但对我没有任何帮助 我尝试过的解决方案

// Declare google ambient
declare var google: any;

package.json
"googlemaps": "^1.12.0"

tsconfig.json
 "types":[ "googlemaps"],

Stackoverflow 问题

Angular 6 - @types/googlemaps/index.d.ts' is not a module

error TS2503: Cannot find namespace 'google'. Angular-7

【问题讨论】:

    标签: angular


    【解决方案1】:

    您是否安装了@types/googlemaps? 如果没有,请尝试安装

    npm i @types/googlemaps
    

    【讨论】:

    • Npm install 在我的项目中出现了一些问题。所以我在节点模块中手动导入了它
    猜你喜欢
    • 1970-01-01
    • 2018-10-03
    • 2016-11-04
    • 1970-01-01
    • 2017-02-15
    • 1970-01-01
    • 2017-05-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多