如何在Mac上通过终端更新node.js和CoffeeScript版本?
我的系统node.js版本是v0.6.1,但当前稳定版本是v0.6.7。 我的系统 CoffeeScript 版本是 v1.1.2 但当前稳定版本是 v1.2.0
如何通过 mac 上的终端(使用 mac )更新 node.js 和 CoffeeScript?我很擅长使用命令行,但我确实需要一些帮助来开始更新这些应用程序。非常感谢您的帮助。
My system node.js version is v0.6.1 but the current stable version is v0.6.7.
My system CoffeeScript version is v1.1.2 but the current stable version is v1.2.0
How could I update the node.js and CoffeeScript via terminal on mac( using mac )? I am pretty good with command line but I do need some help get started to update those applications. Thank you very much for helps.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我是 Homebrew 的粉丝。一旦你安装了它,你就可以
安装 npm
然后用它来安装 CoffeeScript
如果你没有 Homebrew 或者不想打扰它,请将第一步替换为 http://nodejs.org/,单击“下载”,然后运行 OS X 的最新安装程序。无需命令行向导。
更新:自从发布此答案以来,一些事情发生了变化。一是 Homebrew 包含 npm,因此您不需要单独安装它(如果需要,则需要使用
https://
)。另一个是我建议使用 nvm 来安装 Node 而不是 Homebrew,因为您可能想要使用在某些时候,不同的项目有不同的 Node 版本,并且更换 brew 版本并不有趣。I'm a fan of Homebrew. Once you have it installed, you can just do
then install npm with
then use it to install CoffeeScript with
If you don't have Homebrew or don't want to bother with it, replace the first step with going to http://nodejs.org/, clicking "Download," and running the latest installer for OS X. No command line wizardry required.
Update: Since this answer was posted, several things have changed. One is that Homebrew includes npm, so you don't need to install it separately (and if you do, you need to use
https://
). Another is that I would recommend using nvm to install Node rather than Homebrew, since you'll likely want to use different Node versions for different projects at some point and swapping out brew versions is no fun.仅更新咖啡脚本:
To update only coffee-script:
升级 Node.js 版本的最简单方法是使用版本管理器,例如 NVM。如果您愿意,它还会保留您的旧版本以及您为其安装的内容。
升级 Node 版本后,您可以通过 NPM 安装 CoffeeScript。
The easiest way to upgrade your Node.js version is to use a version manager such as NVM. It will also keep your old version if you'd like, along with stuff you've installed for it.
Once you upgrade you Node version, you can install CoffeeScript via NPM.