1) Download sublime and install it, download list:https:///softs/
2) To download the nodejs plug-in of sublime, you need to integrate the Nodejs plug-in into sublime, and download address:/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 "-build", drag and drop to sublime, and display:
{ "cmd": ["node", "$file"], "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", "selector": "", "shell":true, "encoding": "cp1252", "windows": { "cmd": ["taskkill /F /IM & node", "$file"] }, "linux": { "cmd": ["killall node; node", "$file"] } }
The above marked area needs to be changed. To change the encoding to GB2312 or utf8, if this property is not changed, it may cause the terminal to display garbled code when building nodejs code.
7) To use sublime to open the file "-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" // . "/usr/bin/node" or "C:\bin\" "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 }