Search code examples
angulartypescriptnpmangular7

Angular 7: cannot find the type definition file


Yesterday my project worked well but today I encounter an error after the installation of ngx-pagination module:

ERROR in src/app/views/dashboard/step1/step1.component.ts(1,23): error TS2688: Cannot find type definition file for '@types/googlemaps'. src/app/views/dashboard/step1/step1.component.ts(187,34): error TS2304: Cannot find name 'google'. src/app/views/dashboard/step1/step1.component.ts(190,29): error TS2304: Cannot find name 'google'. src/app/views/dashboard/step1/step1.component.ts(193,26): error TS2503: Cannot find namespace 'google'. src/app/views/job/quick-job-form/quick-job-form.component.ts(1,23): error TS2688: Cannot find type definition file for '@types/googlemaps'. src/app/views/job/quick-job-form/quick-job-form.component.ts(182,34): error TS2304: Cannot find name 'google'. src/app/views/job/quick-job-form/quick-job-form.component.ts(188,29): error TS2304: Cannot find name 'google'. src/app/views/job/quick-job-form/quick-job-form.component.ts(191,26): error TS2503: Cannot find namespace 'google'. src/app/views/job/quick-job-form/quick-job-form.component.ts(336,24): error TS2304: Cannot find name 'google'.

Please help me.


Solution

  • It seems that you are using @types/googlemaps in your step1.component.ts file, and other files listed in the error. Remove the utilisation of this component, or install it, with this command:

    npm install --save @types/googlemaps