1) Download sublime and install it, download list: //www.VeVB.COM/softs/132432.html
2) To download the nodejs plug-in of sublime, you need to integrate the Nodejs plug-in into sublime. The download address is: https://github.com/tanepiper/SublimeText-Nodejs
3) Unzip the zip file and rename the folder "Nodejs"
4) Open sublime, operate "preference" --> "Browse packages", and open a directory, which is the storage place for IDE plug-ins in many languages.
5) Copy the "Nodejs" folder to this directory. Is this OK? The sauce looks not good yet, and you still need to change the configuration file.
6) Open the Nodejs folder, find the file "Nodejs.sublime-build", drag and drop to sublime, and display:
{ "cmd": ["node", "$file"], "file_regex": "^[ ]*File /"(...*?)/", line ([0-9]*)", "selector": "source.js", "shell":true, "encoding": "cp1252", "windows": { "cmd": ["taskkill /F /IM node.exe & node", "$file"] }, "linux": { "cmd": ["killall node; node", "$file"] } }You need to change the above marked place. To change the encoding to GB2312 or utf8, if you do not change this property, it may cause the terminal to display garbled code when building nodejs code.
7) To use sublime to open the file "Nodejs.sublime-settings" or set "preference" --》 "package settings" --》 "Nodejs" --》 "setting-default" Open the file and change it to:
{ // save before running commands "save_first": true, // if present, use this command instead of plain "node" // eg "/usr/bin/node" or "C:/bin/node.exe" "node_command": /usr/bin/nodejs, // Same for NPM command "npm_command": /usr/bin/npm, // as 'NODE_PATH' environment variable for node runtime "node_path": false, "expert_mode": false, "ouput_to_new_tab": false}