Skip to content

Instantly share code, notes, and snippets.

@alfredo
Created December 31, 2011 00:24
Show Gist options
  • Save alfredo/1542184 to your computer and use it in GitHub Desktop.
Save alfredo/1542184 to your computer and use it in GitHub Desktop.
Install node.js and coffee-script inside a python virtualenv
To install node.js and coffee-script inside a virtualenv and keep it self-contained:
1. Activate the virtualenv::
$ workon test
2. Move inside the virtualenv directory::
(test)$ cdvirtualenv
3. Export that directory as the prefix for the installation::
(test)$ export PREFIX=`pwd`
4. Get the latest version of node.js from http://nodejs.org/ and unpack it e.g.::
(test)$ wget http://nodejs.org/dist/v0.6.6/node-v0.6.6.tar.gz
(test)$ tar xvfz node-v0.6.6.tar.gz
5. Once inside the unpacked node directory::
(test)$ ./configure --prefix=$PREFIX
(test)$ make
(test)$ make install
6. Check that node.js was installed correctly::
(test)$ which node
7. Fortunately npm (node package manager) is installed with node.js as well, now we can proceed to install coffee-script::
(test)$ npm install -g coffee-script
It seems that npm uses the PREFIX environment variable to determine where to install the node packages, bear this in mind in case you plan to install any other node package.
8. Check that coffe-script was installed successfully::
(test)$ which coffee
9. Play with node.js or coffee-script :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment