標籤:文法 rip ack install code 檔案目錄 build 內容 his
1.下載node.js
sublimeText3- 安裝nodejs外掛程式 ctrl+shift+p — install package —nodejsnode
2.修改設定檔
在 Sublie Text 3 Packages 檔案目錄下, 找到 Nodejs.sublime-settings 檔案,更改以下內容
{ // save before running commands "save_first": true, // if present, use this command instead of plain "node" // e.g. "/usr/bin/node" or "C:\bin\node.exe" "node_command": "E:\\Program Files\\nodejs\\node.exe", //node.js安裝路徑 // Same for NPM command "npm_command": "E:\\Program Files\\nodejs\\npm.cmd", //node.js安裝路徑
// as ‘NODE_PATH‘ environment variable for node runtime "node_path": false, "expert_mode": false, "ouput_to_new_tab": false }
在 Sublie Text 3 Packages 檔案目錄下, 找到 Nodejs.sublime-build 檔案,更改以下內容
{ "cmd": ["node", "$file"], "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", "selector": "source.js", "shell": true, "encoding": "utf8", //此處修改 "windows": { // "cmd": ["node", "$file"], //此處修改 "cmd": ["node", "--use-strict", "--harmony", "$file"], //與上面二選一 相容ES6文法 }, "linux": { "shell_cmd": "killall node; /usr/bin/env node $file" }, "osx": { "shell_cmd": "killall node; /usr/bin/env node $file" }}
重啟,運行。
sublime3安裝javascript控制台環境 方法2