I have a project using nodejs.
I want to format the date using dateformat.
when I try on local it works, but when I upload it to the server, dateformat is unreadable (cannot find module ‘date format’)
this is my code
var date = new Date(); var dateFormat = require('dateFormat'); var periode = dateFormat(date, "yyyy-mm");
I guess you haven’t added the module to the project, you can go to the project directory and run the below command or add this module globally
> npm install dateFormat
Answered By – user3937422
Answer Checked By – Terry (AngularFixing Volunteer)