Build a Node. js development environment in Ubuntu 14.04
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!
Install and configure the Node. js development environment in javasru 12.04
Getting started with Node. Js [PDF + related Code]
Node. js Development Guide hd pdf Chinese version + source code
Node. js getting started Development Guide
Install and configure Node. js
Compile and install Node. js in Ubuntu
Node. js details: click here
Node. js: click here