在sublime text 3中編譯javascript

1.整理步驟:

1).安裝node.js;

2).配置js編譯系統;


2.過程

1).先是按照網上的方法,在配置的時候輸入如下內容:

{
"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"]
}
}


結果一直報 [Decode error - output not utf-8] 錯誤;

2).後來直接把配置內容改爲

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

解決問題了,其中 “D:/Program Files/nodejs/node.exe”是nodejs的路徑


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章