Nodejs sublime text 3安裝與配置_node.js

來源:互聯網
上載者:User

1) 下載sublime並安裝,下載列表:http://www.jb51.net/softs/132432.html

2) 下載sublime的nodejs外掛程式,需是整合Nodejs外掛程式到sublime中,下載地址:https://github.com/tanepiper/SublimeText-Nodejs

3)   解壓zip檔案, 並重新命名檔案夾“Nodejs”

4)   開啟sublime,操作"preference" --> "Browse packages", 開啟一個目錄,這個目錄是眾多語言IDE外掛程式的存放地。

5)   複製”Nodejs“檔案夾到這個目錄。  這樣就可以了嗎? 醬樣子還不行,還要更改設定檔。

6)   開啟Nodejs檔案夾,找到檔案“Nodejs.sublime-build”, 拖拽到sublime,顯示:       

{    "cmd": ["node", "$file"],    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",    "selector": "source.js",    "shell":true,    "encoding": "cp1252",    "windows":     {       "cmd": ["taskkill /F /IM node.exe & node", "$file"]     },    "linux":     {       "cmd": ["killall node; node", "$file"]     }   }

 需要更改上面標註的地方, 要更改encoding為GB2312或者utf8,如果不更改此屬性可能導致build nodejs代碼時終端顯示亂碼。

7)  要用sublime開啟檔案“Nodejs.sublime-settings” 或者 設定“preference” --》 “package settings” --》 “Nodejs”  --》“setting-default” 開啟檔案並 更改成:

{ // 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": /usr/bin/nodejs, // Same for NPM command "npm_command": /usr/bin/npm, // as 'NODE_PATH' environment variable for node runtime "node_path": false, "expert_mode": false, "ouput_to_new_tab": false}

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.