Node. js Development Environment Setup 1. Install the linux System
(Skip this step if you have installed linux)
Recommended Virtual Machine: VirtualBox or Vmware (Professional permanent activation code: 5A02H-AU243-TZJ49-GTC7K-3C61N)
I will use Vmware here.
After Vmware is installed, Click create virtual machine, select to install the operating system later, and then configure. The virtual machine settings are as follows:
{
Client operating system: others;
Version: Other 64-bit;
Virtual Machine name: node. js;
Location: D: \ VM \ node. js;
Other Default values;
}
The Virtual Machine is created, as shown in the right figure.
If you are not at ease, you can ping www.baidu.com. At this time, the virtual machine is connected to the Internet.
Ii. nodejs and related software installation
First, write an xshell installation. (Optional. node. js development is not affected if node. JS is not installed)
Xshell: Xshell can be used to access servers in different remote systems on the Windows interface, so as to better achieve the purpose of remote control terminal.
For more information, see Baidu.
I personally think it is easy to use. After the installation is complete, click "new", enter the name "node", "host node", and the port number 22. Then, enter the login name "root" and the password to enter centos. Because the virtual machine here is a bridge, in order to ensure that the IP address of the virtual machine will not change in the future, I add 192.168.1.59 node to the C: \ Windows \ System32 \ drivers \ etc \ hosts file. In the future, the IP address of the virtual machine will be fixed here to facilitate subsequent development.
/**************** I am a wayward splitting line ***************** ***********/
Install a few items in centos (required !)
1. install an epel and enter the command yum install epel-release.
2. install nodejs. Enter the command yum install nodejs. After the download and installation are complete, enter the command node -- version to check whether the installation is complete.
3. install the mongodb server and enter the command yum install mongodb-server
4. install the mongodb client. Enter the command yum install mongodb. After the download and installation are complete, enter the command mongo -- version to check whether the installation is complete.
5. install redis and enter the command yum install redis. After the download and installation are complete, enter the redis-cli -- version command to check whether the installation is complete.
Node. js
After all the preceding steps are completed, the node. js development environment is built. Congratulations !!!
Iii. Test and run node
Below is a simple program to run.
vim test.jsvar name = "qin";console.log("hello "+name);
Run the command node test. js to save and exit wq. The result is displayed.