Node.js はデフォルトでは日本語関連の ICU データを持っていないので、別途インストールする必要があります。
> npm i full-icu
で、これを指定して実行してあげましょう。
> node -v
v12.1.0
> node --icu-data-dir=node_modules/full-icu -p "new Date().toLocaleDateString('ja-JP-u-ca-japanese', { era: 'long' })"
令和元年5月1日
Go to list of users who liked
More than 5 years have passed since last update.
Node.js はデフォルトでは日本語関連の ICU データを持っていないので、別途インストールする必要があります。
> npm i full-icu
で、これを指定して実行してあげましょう。
> node -v
v12.1.0
> node --icu-data-dir=node_modules/full-icu -p "new Date().toLocaleDateString('ja-JP-u-ca-japanese', { era: 'long' })"
令和元年5月1日
Register as a new user and use Qiita more conveniently
Go to list of users who liked