Error: property ‘TZ’ does not exist on type ‘type of moment’

A new ABP project, NPM install, then NPM start, results in an error: property ‘TZ’ does not exist on type ‘type of moment’

moment.tz.setDefault ( abp.timing.timeZoneInfo . iana.timeZoneId );

Because this paragraph is wrong:


Property 'tz' does not exist on type 'typeof moment'.  TS2339

    24 | 
    25 |   if (abp.clock.provider.supportsMultipleTimezone) {
  > 26 |     moment.tz.setDefault(abp.timing.timeZoneInfo.iana.timeZoneId);
       |            ^
    27 |   }
    28 | 
    29 |   const stores = initializeStores();
This error occurred during the build time and cannot be dismissed.

Serious,

https://blog.csdn.net/qq_ thirty-six million two hundred and seventy-nine thousand four hundred and forty-five

Change here to

import * as moment from ‘moment-timezone’;

 

 

Read More: