1、安装node.js
2、安装sublime_text
3、sublime中配置node.js ,注意重点来了!
在sublime菜单上找到Tools ---> Build System ---> new Build System,复制下面的配置内容:
{
"cmd"
: [
"node"
,
"$file"
],
"file_regex"
:
"^[ ]*File \"(...*?)\", line ([0-9]*)"
,
"selector"
:
"source.js"
,
"encoding"
:
"utf-8"
,
// "encoding": "cp936",根据自己需要编码格式,防止乱码。
"shell"
:
true
,
"windows"
:
{
"cmd"
: [
"taskkill"
,
"/F"
,
"/IM"
,
"node.exe"
,
"&"
,
"node"
,
"$file"
]
},
"linux"
:
{
"cmd"
: [
"killall node; node"
,
"$file"
]
}
}
原文地址:https://www.cnblogs.com/godEric1/p/9595539.html
时间: 2024-10-04 11:54:55