在OSX上安装nodejs的最佳方法是什么?
我看到你可以通过homepage
download nodejs
或install via homebrew
或via macports
install via homebrew
。
这是最好的方法?
是否有select其中一个的理由?
Some things I consider: 1. Ease of upgrading to latest version 2. Ability to (fully) remove and uninstall 3. 1 and 2 should leave no trace of old version (including any temp files), or in case of uninstalling, should fully remove everything.
使用Mac OS X安装程序将来升级更容易。
我更喜欢使用brew
。
一旦安装它像一样容易:
brew install node
完成并完成。
不要了吗?
brew uninstall node
需要升级?
brew upgrade node
另外,它基于git
和社区是非常活跃的。 而且,安装的软件包总是在一个地方,然后符号链接到你的/usr/local/bin
,所以没有混乱的sudo
或多个安装位置。
在这里检查网站
我个人喜欢从源代码编译。 https://github.com/joyent/node/wiki/Installation
您可以使用NVM进行升级和降级,甚至可以随时在不同版本之间切换! https://github.com/creationix/nvm