Recently, I want to find a lightweight service development platform that supports rapid development. I chose Node. js, there were several options at that time: Python + Django (using Django, although the development is fast, but the performance is not very good ). Ruby + ROR ). Node. js. Now that you have selected Node. js, you need to build a development environment. The following uses Ubuntu14.04 for development.
Recently, I was looking for a lightweight service development platform that supports rapid development. I chose Node. js. At that time, I had several options:
- Python + Django ).
- Ruby + ROR ).
- Node. js.
Now that we have selected Node. js, we need to build a development environment. Below we will build a Node. js development environment with Ubuntu 14.04 as the Development Platform:
Ubuntu 14.04 comes with the Node. js version too old, and I tried to install it is not successful, so you need to add Node. js PPA to install the latest version of Node. js, execute in the terminal:
sudo add-apt-repository ppa:chris-lea/node.jssudo apt-get updatesudo apt-get install nodejs
After the installation is complete, run the node-v command to check whether Node. js is successfully installed.
WebStorm is recommended for Node. js IDE, and Java is required for running WebStorm. If Java is not installed on your computer, install it first. If not, Google it.
Go to http://www.jetbrains.com/webstorm/to download the latest webstormfile. After the download is complete, decompress it to a specified directory (the directory is random, as long as you have access permission). After decompression, run bin/webstorm. sh to start WebStorm.
- Create a Node. js project:
Go to the WebStorm development environment and create a Node. js project:
The project type must be Node. js Express App (Express is a Web Framework ).
Configure the version and template of Express. Keep the default value!
The source code of Node. js will be downloaded when you create a project (which is automatically prompted). After the download is complete, the Node. js project will be created.
Enter the Node. js Hello World code:
console.log("Hello World!");
Sub-branch commands in the terminal:
storezhang@Storezhang-Desktop:~$ node test.js Hello World!
Success!
Installation and configuration http://www.linuxidc.com/Linux/2014-05/101418.htm of Node. js development environment under javasru 12.04
Node. Js getting started [PDF + related Code] http://www.linuxidc.com/Linux/2013-06/85462.htm
Node. js Development Guide hd pdf Chinese version + Source http://www.linuxidc.com/Linux/2014-09/106494.htm
Node. js getting started development guide Chinese edition http://www.linuxidc.com/Linux/2012-11/73363.htm
Node. js installation and configuration http://www.linuxidc.com/Linux/2013-05/84836.htm
Ubuntu build and install Node. js http://www.linuxidc.com/Linux/2013-10/91321.htm
Node. js details: Click here
Node. js: Click here
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2
This article permanently updates the link address: Http://www.linuxidc.com/Linux/2014-12/110983.htm