Mac下配置Sublime的NodeJS开发环境
Sublime安装
JavaScript&NodeJS Snippets
插件1。Tools - Build System - New Build System
,输入23:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20{
"cmd": ["/Users/luohanjie/.nvm/versions/node/v4.2.6/bin/node", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.js",
"shell":true,
"encoding": "utf-8",
"windows":
{
"cmd": ["taskkill /F /IM node.exe", ""],
"cmd": ["node", "$file"]
},
"linux":
{
"cmd": ["killall node; node", "$file"]
},
"osx":
{
"cmd": ["killall node; /Users/luohanjie/.nvm/versions/node/v4.2.6/bin/node $file"]
}
}注意
node
的绝对地址。然后保存为Nodejs.sublime-build
并且选择Tools - Build System - Nodejs
建立一个新js文件,输入
console.log("ok");
, 按Control + B
,应该会输出:1
2
3No matching processes belonging to you were found
ok
[Finished in 0.1s]