You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, node only ships with US locale information, e.g. for calls to the Internationalization API or for the locale option to Date.prototype.toLocaleString()
In case where recompiling node is infeasible (for instance when working on a team where one doesn’t have control over other people’s node version), there exists the node package full-icu. That package stores the missing locales to node_modules.
In order to use the locales, node must be provided with the --icu-data-dir command line option, for instance:
$ npx ts-node --icu-data-dir=node_modules/full-icu script.ts
D:\tmp\icu-mwe\node_modules\arg\index.js:90
throw err;
^
Error: Unknown or unexpected option: --icu-data-dir
at arg (D:\tmp\icu-mwe\node_modules\arg\index.js:88:19)
at main (D:\tmp\icu-mwe\node_modules\ts-node\dist\bin.js:35:18)
at Object. (D:\tmp\icu-mwe\node_modules\ts-node\dist\bin.js:448:5 )
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
By default, node only ships with US locale information, e.g. for calls to the Internationalization API or for the
locale
option to Date.prototype.toLocaleString()In case where recompiling node is infeasible (for instance when working on a team where one doesn’t have control over other people’s node version), there exists the node package full-icu. That package stores the missing locales to node_modules.
In order to use the locales, node must be provided with the
--icu-data-dir
command line option, for instance:However, ts-node does not recognize the flag.
I’m unsure if this is actually a bug or expected behaviour, since ts-node does by design not respect all node flags.
Steps to reproduce the problem
Setup the project
Write a script
script.ts
with the following content:To verify that the locales are indeed not loaded, run
and note that the output is in ISO format: “2020-11-10”.
Expected Behavior
should print “10.11.2020”.
Actual Behavior
Specifications
The text was updated successfully, but these errors were encountered: