Use sublime to build NODEJS environment in Windows system _node.js

Source: Internet
Author: User

1. Download Nodejs, and install OK, configure environment variables.

2. Download Sublime Text3

3. Add the node plugin in the package install package (or directly to the Sublimetext-nodejs plugin (https://github.com/tanepiper/SublimeText-Nodejs) download, after downloading, Create a new folder under D:\Program files\sublimetext3\data\packages for Nodejs file name don't make a mistake, and then throw in the files that git downloads.

After downloading is sublimetext-nodejs-master.zip, directly with the compression package opened, the file thrown to D:\Program Files\sublimetext3\data\packages\nodejs under

4. The above is not the point, the focus is here

A lot of online talk is not reliable, you can directly open D:\Program files\sublimetext3\data\packages\nodejs\ Nodejs.sublime-build This file, edit it with Notepad or sublime, edit the code as follows

 {"
 encoding": "GB2312", "
 cmd": ["taskkill/f/im Node.exe", ""],
 "cmd": ["Node", "$file"]
 }
 

5.ok, so you can directly in the sublime inside a new Node.js file, run a run, directly under the sublime F7 can

var http = require (' http ');
var OS = require (' OS ');

Http.createserver (function (request, response) {
response.writehead ({' Content-type ': ' Text/plain '});
Response.End (' Hello World3 \ n ');

}). Listen (3000);

Console.log (' Server running at Http://127.0.0.1:3000/');

6. Students asked, how can I restart node, I am sorry, I did not find the final solution, only to say so temporarily

1 manually open the Task Manager, turn off the node.exe process, and restart F7

2 The global installation of Nodejs Plug-ins, supervisor, installed, directly with sublime write node JS code, you do not have to back and forth of the restart node, it will automatically detect JS, and restart node port, quite comfortable.

The above mentioned is the entire content of this article, I hope you can enjoy.

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.