在sublime text 3中编译javascript

1.整理步骤:node

1).安装node.js;linux

2).配置js编译系统;shell


2.过程windows

1).先是按照网上的方法,在配置的时候输入以下内容:spa

{
"cmd": ["node", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"working_dir": "${project_path:${folder}}",
"selector": "source.js",
"shell": true,
"encoding": "utf-8",
"windows": {
"cmd": ["node", "$file"]
},
"linux": {
"cmd": ["killall node; node", "$file"]
}
}
code


结果一直报 [Decode error - output not utf-8] 错误;utf-8

2).后来直接把配置内容改成cmd

{
"cmd":["D:/Program Files/nodejs/node.exe","$file"],
"selector":"*.js"
}
编译

解决问题了,其中 “D:/Program Files/nodejs/node.exe”是nodejs的路径ejs

相关文章
相关标签/搜索