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 badges2 Answers
Reset to default 8You 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