Why Can't I set moment locale in node?
According to the documentation there is a bug that prevents moment.locale from being loaded. So you can use the following code.
var moment = require('moment');require('moment/locale/fr');console.log(moment.locale());
You can use:
import moment from "moment";import "moment/locale/es";
According to the current documentation it is possible:
var moment = require('moment');moment.locale('fr');console.log(moment().format());