../node_modules/@types/moment-timezone/moment-timezone.d.ts:63:11 中出现错误 - 错误 TS2451:无法重新声明块范围变量“tz”;

发布于 2025-01-16 07:59:15 字数 890 浏览 1 评论 0原文

我尝试在我的角度样板框架上安装(“ngx-persian-datepicker”:“^0.1.3”)。 但是当我运行“npm start”时,我收到此错误。

ERROR in ../node_modules/@types/moment-timezone/moment-timezone.d.ts:63:11 - error TS2451: Cannot redeclare block-scoped variable 'tz'.
63     const tz: MomentTimezone;
             ~~

  ../node_modules/moment-timezone/index.d.ts:73:11
    73     const tz: MomentTimezone;
                 ~~
    'tz' was also declared here.
../node_modules/moment-timezone/index.d.ts:73:11 - error TS2451: Cannot redeclare block-scoped variable 'tz'.

73     const tz: MomentTimezone;
             ~~

  ../node_modules/@types/moment-timezone/moment-timezone.d.ts:63:11
    63     const tz: MomentTimezone;
                 ~~
    'tz' was also declared here.

我尝试了不同版本的@types/moment-timezone,但没有成功。 另外,我尝试了不同的模块,例如“@angular-persian/material-date-picker”,但我再次收到此错误。 我无法理解这个错误的用途。 谁能帮助我吗?

I tried to install ( "ngx-persian-datepicker": "^0.1.3" ) on my angular boilerplate framework.
but wen i run "npm start" , I get this error.

ERROR in ../node_modules/@types/moment-timezone/moment-timezone.d.ts:63:11 - error TS2451: Cannot redeclare block-scoped variable 'tz'.
63     const tz: MomentTimezone;
             ~~

  ../node_modules/moment-timezone/index.d.ts:73:11
    73     const tz: MomentTimezone;
                 ~~
    'tz' was also declared here.
../node_modules/moment-timezone/index.d.ts:73:11 - error TS2451: Cannot redeclare block-scoped variable 'tz'.

73     const tz: MomentTimezone;
             ~~

  ../node_modules/@types/moment-timezone/moment-timezone.d.ts:63:11
    63     const tz: MomentTimezone;
                 ~~
    'tz' was also declared here.

I tried differenet versions of @types/moment-timezone but i did not work.
Also, I tried different modules like "@angular-persian/material-date-picker" but i get this error again.
I cant understand what this error is for.
can anyone help me?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文