1. Install Dependency Pack
Copy Code code as follows:
sudo apt-get install g++ Curl Libssl-dev apache2-utils
sudo apt-get install Git-core
2. Download source code
Copy Code code as follows:
git clone git://github.com/ry/node.git
This step is due to poor network condition has been shown cloning to node ...
Can download the source code directly from the official net, unzip to the account folder.
The file name was changed to node.
3. Compile
Three sentences:
Copy Code code as follows:
./configure
Make
sudo make install
Screenshot after successful installation:
4. Test
Write the following applet, named Example.js, saved in the node folder.
Copy Code code as follows:
var http = require (' http ');
Http.createserver (function (req, res) {
Res.writehead ({' Content-type ': ' Text/plain '});
Res.end (' Hello node.jsn ');
}). Listen (8124, "127.0.0.1");
Console.log (' Server running at http://127.0.0.1:8124/');
Execute the following command:
Run Result:
After the application is convenient, you should also set up environment variables, install NPM, such as work?
Just start, still need further study ...
Annoying confidential inspection, the collation of information to the ...