標籤:解決方案 編譯 coffee 安裝 出錯
今天嘗試用Sublime Text編譯CoffeeScript
先安裝了CoffeeScript的外掛程式, 然後編譯器中多了一項CoffeeScript, 但是嘗試編譯卻提示出錯, 然後上網尋找解決方案無解…於是就自己嘗試去改了下SublimeText的build命令, 結果成功了
出錯資訊如下:
/usr/local/lib/node_modules/coffee-script/lib/coffee-script/cake.js:111 throw new Error("Cakefile not found in " + (process.cwd())); ^Error: Cakefile not found in /home/bill/Desktop at cakefileDirectory (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/cake.js:111:11) at cakefileDirectory (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/cake.js:109:14) at cakefileDirectory (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/cake.js:109:14) at cakefileDirectory (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/cake.js:109:14) at Object.exports.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/cake.js:51:19) at Object.<anonymous> (/usr/local/lib/node_modules/coffee-script/bin/cake:7:38) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:929:3[Finished in 0.1s with exit code 8]
解決方案:
開啟CoffeeScript外掛程式的位置(我的是”/usr/share/sublime-text/Data/Packages/CoffeeScript”)中的CoffeeScript.sublime-build檔案, 將內容修改為{ "cmd": ["coffee", "$file"], "selector": "source.coffee" }
然後就可以用Sublime Text編譯Coffee檔案了
Sublime Text編譯CoffeeScript出錯解決方案