1) Download sublime and install it, download list: http://www.jb51.net/softs/132432.html
2) Download the nodejs plug-in for sublime. You need to integrate the Nodejs plug-in into sublime. Download address: 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 where many language IDE plug-ins are stored.
5) Copy the "Nodejs" folder to this directory. Is this enough? If it still doesn't work, you still need to change the configuration file.
6) Open the Nodejs folder, find the file "Nodejs.sublime-build", drag it to sublime, it will 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"] } }
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" // e.g. "/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 }