简体   繁体   中英

How to brew install node.js with Intl?

I was expecting that Intl object was included by default in node v0.12, but when I install node via brew it is not:

$ node -v
v0.12.2
$ node 
> console.log(Intl)
ReferenceError: Intl is not defined

How can i get the Intl object when installing nodejs via brew? I've seen I can do brew install node --with-icu4c , but it seems it install the whole ICU set – while I'd like to install only the small set , which includes the full Intl API only with english.

Am I missing something?

$ brew install node installs the small set for Intl by default.

See: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/node.rb#L45-L49

Use $ brew install node --with-full-icu in order to install the full set .

$ node -v
v0.12.2
$ node 
> console.log(Intl)
{}
undefined

Try running brew update and install again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM