Title: How to Install Node.js Author: Node Knockout Date: Sat, 11 Sep 2010 22:40:19 GMT Node: v0.2.1
This was the first in a series of posts leading up to Node.js Knockout on how to use node.js.
I have been given permission to repost the articles from the contest here (in wheat format) for general consumption. Expect more to come.
In this post we detail how to install node on Mac, Ubuntu, and Windows.
If you're using the excellent homebrew package manager, you can
install node with one command: brew install node
.
Otherwise, follow the below steps:
- Install Xcode.
- Install git.
- Run the following commands:
<how-to-install-nodejs/darwin_setup.sh>
You can check it worked with a simple Hello, World! example.
-
Install the dependencies:
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
-
Run the following commands:
<how-to-install-nodejs/ubuntu_setup.sh>
You can check it worked with a simple Hello, World! example.
Thanks to code-diesel for the Ubuntu dependencies.
Currently, you must use cygwin to install node. To do so, follow these steps:
-
Use
setup.exe
in the cygwin folder to install the following packages:- devel → openssl
- devel → g++-gcc
- devel → make
- python → python
- devel → git
-
Open the cygwin command line with
Start > Cygwin > Cygwin Bash Shell
. -
Run the below commands to download and build node.
<how-to-install-nodejs/cygwin_setup.sh>
For more details, including information on troubleshooting, please see the GitHub wiki page.
Here's a quick program to make sure everything is up and running correctly:
<how-to-install-nodejs/hello_node.js>
Run the code with the node
command line utility:
> node hello_node.js
Server running at http://127.0.0.1:8124/
Now, if you navigate to http://127.0.0.1:8124/ in your browser, you should see a nice message.
You've installed node.js.