Use Sublime in Windows to build the nodejs environment _ node. js

Source: Internet
Author: User
Recently, I have been studying Nodejs development. as the saying goes, to do a good job, you must first sharpen the tool. of course, you must find a handy editor to start. Here we chose SublimeText3. apart from the beautiful user interface, what attracts me most is its plug-in extension function and cross-platform features. 1. download nodejs, install OK, and configure environment variables.

2. download sublime text3

3. add the node plug-in the package install package (or directly go to the SublimeText-Nodejs plug-in (https://github.com/tanepiper/SublimeText-Nodejs) to download the plug-in, after the download, in D: \ Program Files \ SublimeText3 \ Data \ Packages do not make a mistake in creating a folder named Nodejs file name, and then throw all the Files downloaded from git)

Download sublimetext-nodejs-master.zip. open the package directly and then drop the file under D: \ Program Files \ SublimeText3 \ Data \ Packages \ Nodejs.

4. None of the above is the focus.

Many of the information on the Internet is unreliable. you can directly open D: \ Program Files \ SublimeText3 \ Data \ Packages \ Nodejs. use Notepad or sublime to edit the sublime-build file. edit the code as follows:

 { "encoding": "GB2312", "cmd": ["taskkill /F /IM node.exe", ""], "cmd": ["node", "$file"] } 

5. OK, so that you can create a node. js file in sublime directly and run it. then, run F7 under sublime.

var http = require('http');var os = require('os');http.createServer(function (request, response) {response.writeHead(200, {'Content-Type': 'text/plain'});response.end('Hello World3 \n');}).listen(3000);console.log('Server running at http://127.0.0.1:3000/');

6. I asked my colleagues how to restart the node. sorry, I didn't find the final solution.

1. manually open the Task Manager, shut down the node.exe process, and re-run F7

2) install the node. js plug-in and supervisor globally. after installation, directly use sublime to write the node's js code, so you don't need to restart the node back and forth. it will automatically detect js, restart the node port, which is quite comfortable.

The above is all the content of this article. I hope you will like it.

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.