进入网址https://github.com/tanepiper/SublimeText-Nodejs下载安装包后在 Sublie Text 3 Packages 文件目录下,
找到 Nodejs.sublime-settings
文件,更改以下内容解压放到Sublime Text3Packages 目录下。
修改如下:
{ // save before running commands "save_first": true, // if present, use this command instead of plain "node" // e.g. "/usr/bin/node" or "C:in ode.exe" "node_command": "C:\Program Files\nodejs\node.exe" , // Same for NPM command "npm_command": "C:\Program Files\nodejs\npm.cmd", // as 'NODE_PATH' environment variable for node runtime "node_path": false, "expert_mode": false, "ouput_to_new_tab": false }
然后 找到 Nodejs.sublime-build
文件,更改以下内容
{ "cmd": ["node", "$file"], "file_regex": "^[ ]*File "(...*?)", line ([0-9]*)", "selector": "source.js", "shell":true, "encoding": "utf8", "windows": { "cmd": ["taskkill","/F", "/IM", "node.exe","&","node", "$file"] }, "linux": { "cmd": ["killall node; node", "$file"] }, "osx": { "cmd": ["killall node; node $file"] } }
改好之后即可。