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.