Optimal way to install and keep Node.js & packages up-to-date on OS X?

时间:2021-11-04 20:09:49

What is the cleanest or most optimal way to keep an up-to-date installation of Node along with its accompanying packages on OS X? Homebrew always seems a touch behind (except for head).

在OS X上保持最新安装Node及其附带软件包的最简洁或最佳方法是什么?自制软件似乎总是落后(除了头部)。

Additionally, an interesting observation from the Node.js wiki says:

另外,Node.js维基的一个有趣的观察结果是:

Warning: brew installs are known to be buggy

警告:众所周知,brew安装有问题

Further, is there a preferred method to update the installed packages as well (across node updates and just generally updating them)?

此外,是否有一种更新已安装软件包的首选方法(跨节点更新,只是更新它们)?

2 个解决方案

#1


3  

I use a tool called NVM to manage Node.js installation; you can install and switch to various versions of Node.js with a single command. You can find NVM at https://github.com/creationix/nvm.

我使用一个名为NVM的工具来管理Node.js的安装;您可以使用单个命令安装和切换到各种版本的Node.js.您可以在https://github.com/creationix/nvm找到NVM。

You may be interested in the first half of this screencast that covers installing and using NVM (full disclosure: I made the screencast).

您可能对此截屏的前半部分感兴趣,其中包括安装和使用NVM(完全披露:我制作了截屏视频)。

#2


0  

I personally switched back to homebrew because installing the official package would foul up my path and which version of node I use.

我亲自切换回自制软件包,因为安装官方软件包会弄乱我的路径以及我使用的节点版本。

And node packages shall not be installed globally so every new npm install will fetch the newest version if asked to do so.

并且节点包不应全局安装,因此如果要求,每个新的npm安装都将获取最新版本。

#1


3  

I use a tool called NVM to manage Node.js installation; you can install and switch to various versions of Node.js with a single command. You can find NVM at https://github.com/creationix/nvm.

我使用一个名为NVM的工具来管理Node.js的安装;您可以使用单个命令安装和切换到各种版本的Node.js.您可以在https://github.com/creationix/nvm找到NVM。

You may be interested in the first half of this screencast that covers installing and using NVM (full disclosure: I made the screencast).

您可能对此截屏的前半部分感兴趣,其中包括安装和使用NVM(完全披露:我制作了截屏视频)。

#2


0  

I personally switched back to homebrew because installing the official package would foul up my path and which version of node I use.

我亲自切换回自制软件包,因为安装官方软件包会弄乱我的路径以及我使用的节点版本。

And node packages shall not be installed globally so every new npm install will fetch the newest version if asked to do so.

并且节点包不应全局安装,因此如果要求,每个新的npm安装都将获取最新版本。