javascript - Ionic 2 RC0 Property 'tz' does not exist on type 'typeof moment' - Stack Overflow

Recently Ionic released the RC0 of Ionic Framework and I am exciting. But I use moment-timezone and it

Recently Ionic released the RC0 of Ionic Framework and I am exciting. But I use moment-timezone and it generated an error.

I installed moment and moment-timezone like so:

npm install --save moment moment-timezone

typings install --save --global dt~moment dt~moment-timezone

Then I import moment and tz like so:

import moment from 'moment';
import 'moment-timezone';

When I run ionic build I got error:

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

My ionic info result is:

Cordova CLI: 6.3.1
Gulp version:  CLI version 3.9.1
Gulp local:   Local version 3.9.1
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
ios-deploy version: 1.8.6
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v5.11.1
Xcode version: Xcode 7.3.1 Build version 7D1014

Someone can help me?

Thanks!

Recently Ionic released the RC0 of Ionic Framework and I am exciting. But I use moment-timezone and it generated an error.

I installed moment and moment-timezone like so:

npm install --save moment moment-timezone

typings install --save --global dt~moment dt~moment-timezone

Then I import moment and tz like so:

import moment from 'moment';
import 'moment-timezone';

When I run ionic build I got error:

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

My ionic info result is:

Cordova CLI: 6.3.1
Gulp version:  CLI version 3.9.1
Gulp local:   Local version 3.9.1
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
ios-deploy version: 1.8.6
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v5.11.1
Xcode version: Xcode 7.3.1 Build version 7D1014

Someone can help me?

Thanks!

Share Improve this question asked Sep 29, 2016 at 21:26 Joel BanzattoJoel Banzatto 1472 silver badges9 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 8

You can try this:

npm install @types/moment-timezone --save

Since rc0 ionic stopped using typings and switched to @types. So delete typings folder and typings.json

Install moment typings like so

npm install @types/moment --save

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742322384a4422073.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信