简体   繁体   English

如何使用Intl brew安装node.js?

[英]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: 我期望在节点v0.12中默认包含Intl对象,但是当我通过brew安装节点时,它不是:

$ 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? 如何通过brew安装nodejs时获取Intl对象? 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. 我已经看到我可以做brew install node --with-icu4c ,但它似乎安装了整个ICU集 - 而我只想安装小集 ,其中包括完整的Intl API只有英文。

Am I missing something? 我错过了什么吗?

$ brew install node installs the small set for Intl by default. $ brew install node默认为Intl安装小集

See: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/node.rb#L45-L49 请参阅: 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 . 使用$ brew install node --with-full-icu来安装完整集

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

Try running brew update and install again. 尝试运行brew update并再次安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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