Closed A-Seraph closed 1 year ago
您的邮件已收到,我会尽快给您回复。
I tried using AI to solve the problem. Just in case anyone else comes across this, all I had to do was remove the curly brackets. So the first line should be:
const moment = require('moment-timezone');
Environment
I'm using Moment-Timezone, installed with npm on a project using Node.js. I am trying to use the code example given in the docs:
I installed Moment-Timezone using the command from the docs:
npm install moment-timezone --save
I have required moment-timezone at the top of the file:
const { moment } = require('moment-timezone');
Issue description
The error I get is:
TypeError: Cannot read properties of undefined (reading 'tz')
Could someone tell me what I am doing wrong here please?