What is Node. js? Return the server-side javascript? I will not explain this concept in this article. I can search for it myself to find out that server-side js is not a new technology, but a recent node. the popularity of js broke out. I will explain what node is in a later article. js? 1.1.23 this is just a pure setup, and the environment is not even available. What server-side js is playing? Everything has become a cloud. Let's first build an environment and enter a "hello world" page.
Right. If you build Windows 7, you only need to follow me step by step. It's okay. You don't need to know too much details. It's not something we need to care about now, our primary goal now is to set up the environment, otherwise there will be no further steps.
Step 1. Download Node. js is to be installed under Cygwin in windows. Download The Cygwin installer from the Cygwin website.
Cygwin Website: http://cygwin.com/
Direct: http://cygwin.com/setup.exe
Step 2. Install
To install the Cygwin program, you only need to perform the next step.
On the Choose A Download Source Page, select "install from internet ".
On the Select Your Internet Connection page, Select> Direct Connect
Select "-" On the Choose A Download Site interface and select the downloaded image. We recommend that you use the Japanese website ending with. jp, which is faster.
Note: If you are installing it for the first time, a warning may pop up, regardless of whether you care about it, click OK.
Step 3. Select the installation component
Note: because there are many components, we recommend that you search for them. Click the name to select the image. A small square is displayed after the image is selected, and X (Cross) indicates the image is selected.
Devel category
Gcc-g ++: C ++ compiler
Gcc-mingw-g ++: Mingw32 support headers and libraries for gcc c ++
Gcc4-g ++: G ++ subpackage
Git: Fast Version Control System-core files
Make: The GNU version of the 'make' utility
Openssl-devel: The OpenSSL development environment
Pkg-config: A utility used to retrieve information about installed libraries
Zlib-devel: The zlib compression/decompression library (development)
Editor category
Vim: Vi IMproved-enhanced vi editor
Python Classification
All
Note: All security ?, You just need to click the icon on the Right of Python to switch to Install.
Web Classification
Wget: Utility to retrieve files from the WWW via HTTP and FTP
Curl: Multi-protocol file transfer command-line tool
After the next step, you will be prompted that many dependent components need to be installed. Simply follow the next step.
Note: Since all components are downloaded online, it may take a long time to wait.
Step 4. Run ash.exe
After the installation is complete, an icon will be generated on the desktop (if you select an icon to be generated on the desktop). Do not run this icon!
Open the folder and go to the C: \ cygwin \ bin \ directory. This is the default installation directory. If you have modified the installation directory, go to the bin directory under cygwin's installation directory.
Run ash.exe
Execute the./rebaseall-v command in the pop-up command window.
After the command is executed, execute exit to exit ash.
Step 5. Download and install Node. js
Run the Cygwin program on the desktop.
Enter the wget http://nodejs.org/dist/node-v0.4.7.tar.gz in the Command window and press Enter.
Note: I am writing this article about node. the latest version of js is node-v0.4.7, http://nodejs.org/dist/node-v0.4.7.tar.gz is node. js, you can go to node when reading this article. the js website can be replaced with the latest download path.
Node. js Website: http://nodejs.org/
Enter the tar xf node-v0.4.7.tar.gz in the Command window, node-v0.4.7.tar.gz for your own version.
Enter the cd node-v0.4.7 in the Command window and press Enter.
Enter./configure in the Command window and press Enter.
Enter make in the Command window and press Enter.
Enter make install in the Command window and press Enter.
OK. Now you have installed node. js.
Enter node-version in the Command window and press enter to check your node. js version.
Step 6. Set DNS Open the folder and go to the C: \ cygwin \ etc \ folder.
Manually create the resolv. conf file.
Use NotePad to open the newly created resolv. conf file and add the following
Nameserver 8.8.8.8
Nameserver 8.8.4.4
Save and close.
Step End. Test whether Node. js can be run
Now that you have completed the setup, but you don't know if it can run correctly, let's write an example file to test it.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service