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

后端 未结 10 850
梦谈多话
梦谈多话 2020-12-04 14:25

I want to use the Google Maps API with my Angular project, so I used these two commands to install npm packages:

npm install @agm/core --save-dev
npm install         


        
10条回答
  •  生来不讨喜
    2020-12-04 14:42

    You can avoid this error next way:

    After you have installed

    npm install @types/googlemaps --save-dev

    Go to src/tsconfig.app.json and add next line:

    "compilerOptions": {
        ...,
        "types": [
             "googlemaps"
        ],
        ...,
    },
    

提交回复
热议问题