I am trying to use the moment-timezone npm package in my meteor app to no avail. If I use the atmosphere package, everything runs just fine. However I would like to get the npm package running as the atmosphere one is no longer being maintained. I have removed the atmosphere package completely from the app before trying to get it running via npm.
When I run meteor npm list --tree
, towards the bottom the moment-timezone package and its dependency appear:
└─┬ moment-timezone@0.5.23
└── moment@2.22.2
and meteor npm install
gives:
audited 107 packages in 1.913s
found 0 vulnerabilities
In the file where I'm using moment-timezone I have
import moment from 'moment-timezone';
But the javascript console shows it is failing on the import of both moment and moment-timezone:
SyntaxError: Unexpected identifier 'moment'. import call expects
exactly one argument.
Following the console error, these two lines in two separate files are highlighted in red
import moment from 'moment';
import moment from 'moment-timezone';
So it looks to me that it isn't able to resolve the packages, but it appears as if they have been installed correctly and meteor npm install has worked fine.
The app is meteor 1.8
I'm out of ideas - any help would be greatly appreciated!
Cheers