How do brew install node.js with Intl?

I was expecting the object Intl

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 an Intl object when installing nodejs via brew? I saw what I can do brew install node --with-icu4c

, but it seems to install the entire ICU suite, while I would only like to install a small suite that includes the full Intl API with English only.

Am I missing something?

+3


source to share


1 answer


$ brew install node

by default sets a small set for Intl

.

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

Use $ brew install node --with-full-icu

to install a complete set.



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

      

Try to run brew update

and install again.

+2


source







All Articles