How to build a node.js development environment in Linux


This article mainly explains how to build a node.js development environment for Linux. Interested friends may wish to take a look. The method described in this article is simple, quick and practical. Next, let the editor show you how to build a node.js development environment for Linux!

1. Because there is no server here, we build a Linux environment locally through a virtual machine, so we first need to download virtuabox, Baidu or Google search for virtuabox download.


After entering, you can choose according to your operating system. Here we take window as an example.

2. Create a virtual machine, virtualbox installation is not difficult, the next step is enough. After installation, create a virtual machine, click New, and then set as shown in the figure, because we install centos64 here. If you install other linux, you can choose correspondingly. The next step is the next step in the whole process. Just choose the default

The memory can be set according to your own computer memory

3. After the virtual machine is created, you need to install a mirror image for it, that is, the operating system. Install centos here and go to the next one on the Internet.

If you are using a router to access the Internet, select the bridge here

and then start the network, select the default language, try not to choose Chinese, so as to avoid some unnecessary problems, choose the software


to install the hard disk, enter the key points, cancel it first, then select

and wait for the installation. During the installation process, you can choose to set the password of the root user, or add other

After installation, you need to set up the virtual machine network card settings,

vi /etc/sysconfig/network-scripts/ifcfg-enp0s3

Open the configuration file through vi, if you use vi, after opening the file, press i on the keyboard to enter the modification mode, change the onboot attribute to yes, press esc, shitf+:, and then wq to exit and save.

systemctl restart network

Restart the network card through the command, if there is an assigned address, it will be fine,

If you don’t understand the above steps, you can Baidu the virtual machine installation, and centos installation, etc., you can have a detailed introduction and specific parameter configuration

4. Install the necessary software. After the installation process, you will be asked to choose, y/n, all of which are y, and the following software installations are the same

yum install epel-release

Install nodejs,

yum install nodejs

Install the server of mongodb-server

yum install mongodb-server

Install mongodb

yum install mongodb

Install redis

yum install redis

5. The basic environment is installed, and you can enter node directly by entering node on the command line. Then let's see how to link and develop under the window. Here we use securecrtportable. You can download xshell, which is the same.

After clicking the connection, you can use this command line to operate.

Then open sublime text and download the sftp plug-in. This plug-in can map and synchronize the local project directory and the project directory on the server.

Set it as follows, but one thing to note is that the remote-path corresponds to the server directory. It only needs an existing directory. Then there are some other parameter configurations. You can configure when to upload synchronously and so on. 

//The tab key will cycle through the settings when first created//visit For help//sftp, ftp or ftps "type": "sftp",//Connection method "savebefore upload": true,//Upload "upload_on_save" before saving: true,//Upload "sync_down_on_open": false when saving,
Sync_skip deletes ": false,
Sync_same_age ": true,
Confirm_downloads ": false,
'confirm_sync': true,
Confirm_overwrite_new ": false,
"Host": "nodejs",//host name or address "user": "root",//user name for connection "password": "sunlandong",//password//"port": "22", "remote_path": "/home/nodejs/",//mapping directory between local directory and server directory. It should be noted that the server directory must have "ignore_regexes" in advance: "[
. sub lime - (project | workspace) "," sftp configure (- alt   d?)?  . json ",
Sftp settings  . Json ","/venv/","  . Svn/","  . Hg/","  . Git/",
. bzr "," _darcs "," cvs ","  . Ds_store "," thumbs  . Db "," desktop  . Ini "
],//Ignore rules//"file_permissions": "664",//"dir_permissions": "775",//"extra_list_connections": 0, "connect_timeout": 30,
//"Keepalive": 120,//"ftp_passive_mode": true,//"ftp_obey_assive_host": false,//"ssh_key_file": "~/. ssh/id_sa",//"sftp_flags": ["- f", "/path/to/ssh_config"],//"preserve modification_times": false,//"remote_time_offset_inhours": 0,//"remote_encoding": "utf-8",//"remote_locale": "c",//"allow_config_upload": false,}

Copyright Description:No reproduction without permission。

Knowledge sharing community for developers。

Let more developers benefit from it。

Help developers share knowledge through the Internet。

Follow us