Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update node.js and CoffeeScript version via terminal on mac?

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.

like image 852
MMA Avatar asked Jan 10 '12 15:01

MMA


3 Answers

I'm a fan of Homebrew. Once you have it installed, you can just do

brew install node

then install npm with

curl http://npmjs.org/install.sh | sh

then use it to install CoffeeScript with

npm install -g coffee-script

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.

like image 102
Trevor Burnham Avatar answered Oct 18 '22 08:10

Trevor Burnham


To update only coffee-script:

sudo npm update coffee-script -g

like image 12
Andrei Karpushonak Avatar answered Oct 18 '22 07:10

Andrei Karpushonak


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.

like image 8
alessioalex Avatar answered Oct 18 '22 09:10

alessioalex